Archive for April, 2011

How to always reference latest version of jQuery

As you are aware that already many version of jQuery is released and the latest version is 1.5.2. And jQuery 1.6 is around the corner. When you are referencing the jQuery from CDN then you need to specify the version number as well so that version gets loaded. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"> </script> Above code will […]
Read the rest of this entry »

How to load jQuery locally when CDN fails

There are couple of advantage if you load your jQuery from any CDN. Read my post about "jQuery Tip : Always load your jQuery framework from CDN". It is a good approach to always use CDN but sometimes what if the CDN is down (rare possibility though) but you never know in this world as […]
Read the rest of this entry »

Validate email address using jQuery

This is a very basic functionality to validate the email address. In this post, I will show you how to validate the email address using jQuery. To validate the email address, I have created a separate function which based on email address, returns true or false. Email address validation is done using regular expression. Earlier […]
Read the rest of this entry »

Find which mouse button clicked using jQuery

For one of my requirement, I need to determine which mouse button (Left, Middle or Right) was clicked. jQuery provides mousedown() event, using which we can check which mouse button is clicked. For key or button events, event attribute indicates the specific button or key that was pressed. event.which will give 1, 2 or 3 […]
Read the rest of this entry »

Restrict Shift Key using jQuery

There is a very basic requirement of restrict numbers in a textbox And we implement the code to restrict other characters than 0 to 9. But there is a loop hole that sometimes not checked, that is using Shift Key and number key combination, user can still type special characters like @,#,$ etc.Below jQuery code […]
Read the rest of this entry »

jQuery to Retrieve Server’s current date and time with ASP.NET

In this post, we will see how to retrieve server's current date and time without using ajax. It's very simple and one line of ASP.NET code can help you to retrieve the server's current date & time. For demo, I have placed a textbox and will fetch the Server's date and time and display it […]
Read the rest of this entry »