Archive | JavaScript RSS feed for this section

Interesting JavaScript Toolkit

18 Mar

Every day interesting things appears on front of us, this JavaScript ToolKit appears to be a great tool, let’s play around a little with it to see.

Ref:http://www.dojotoolkit.org/

Advertisements

Examples using Mega Menus

25 Feb

-Ref:http://msmvps.com/blogs/deborahk/archive/2010/02.aspx

—Ref:http://designm.ag/inspiration/mega-menus/

Example:

Ref:http://www.javascriptkit.com/script/script2/jkmegamenu.shtml

Detecting a Client’s screen resolution in ASP.NET

23 Feb

Ref:http://devcity.net/Articles/64/1/screenresolution.aspx

Default.aspx Code:

public void Page_Load(Object sender, EventArgs e){

if (Session[“ScreenResolution”] == null) {
// Session variable is not set
// Redirect to the screen resolution detection script
Response.Redirect(“detectscreen.aspx”);
} else {
// Session variable is set
// Display it on the page
screenresolution.Text = Session[“ScreenResolution”].ToString();
}
}

detectScreen.aspx Code:

<script runat=”server” language=”C#”>

public void Page_Load(Object sender, EventArgs e){

if (Request.QueryString[“action”] != null) {
// store the screen resolution in Session[“ScreenResolution”]
// and redirect back to default.aspx
Session[“ScreenResolution”] = Request.QueryString[“res”].ToString();
Response.Redirect(“cat.aspx”);
}
}
// JavaScript code below will determine the user screen resolution
// and redirect to itself with action=set QueryString parameter

</script>
<script language=”javascript”>
res = “&res=”+screen.width+”x”+screen.height+”&d=”+screen.colorDepth
top.location.href=”detectscreen.aspx?action=set”+res
</script>

Passing Value from Javascript to ASP.Net

19 Feb

Ref:http://forums.asp.net/p/1211504/2139016.aspx

<script type="text/javascript">
function abc()
{
  var str="value";
  document.getElementById("TextBox3").value=str;
}

</script>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" OnClientClick="abc()"  Text="Button"
            onclick="Button1_Click" />
    </div>
    </form>
</body>

Code Behind:

    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Write(TextBox3.Value.ToString);
    }

Javascript Loading Indicator

19 Feb

Tested on Asp.Net Page with google maps API and works perfect.

Ref:http://anirudhs.chaosnet.org/blog/2004.08.28.html

Good javascript examples

4 Dec

This site have useful examples using javascript.

Ref:http://www.phatfusion.net/

Pestañas ó Tabs con AJAX, CSS y JavaScript

4 Dec

Ref:http://www.ribosomatic.com/articulos/pestanas-o-tabs-con-ajax-css-y-javascript/

Very usable post.