All jQuery Code Examples

jQuery Namespacing with on() and off() method

With jQuery 1.7, jQuery team introduced 2 new ways to attach and remove events. on() method is used for attaching events to DOM elements, and off() method is used to removed event handlers. And you should use on() and off() only to attach and remove handlers, instead of bind(), live() and delegate(). Related Post: bind() […]
Read the rest of this entry »

Highlight Negative value columns in ASP.NET GridView using jQuery

In this post, find jQuery code to highlight negative value columns/cells in ASP.NET GridView. This is a helpful feature as it draws user's attention immediately and informs him that there is something wrong with some of the entities. Related Post: jQuery.isNumeric in jQuery 1.7 Download ASP.NET GridView & jQuery Tips and Tricks eBook PDF Common […]
Read the rest of this entry »

jQuery to remove duplicate items from array

Find jQuery code to remove duplicate items from an array using $.unique(). Earlier I had posted about jQuery solution to remove item from array, split an array, combine/join arrays and Find index of element in array, And In this post, find how to remove duplicate items from array with example. $(document).ready(function () { var arr […]
Read the rest of this entry »

Check/uncheck checkboxes in Asp.net GridView using jQuery

Find out jQuery code to check/uncheck or select/deselect all the checkboxes in ASP.NET Gridview. There are already plenty of articles on this topic but then how this is different. Assume, all the checkboxes are checked when header checkbox is checked but then you uncheck one of the child checkbox then what happens to your header […]
Read the rest of this entry »

jQuery to highlight GridView Rows when Checkbox is checked in ASP.NET

In this post, Find out jQuery code to highlight ASP.NET Gridview row when checkbox is checked and restore it to original state when unchecked. Also Read: GridView and jQuery in ASP.NET How to do it? Bind the click event to all the checkbox of ASP.NET GridView. $('#<%=gdRows.ClientID%>') .find('input:checkbox[id$="chkDelete"]') .click( function() { }); In the click […]
Read the rest of this entry »

jQuery code to fetch thumbnail of youtube video

In this post, find jQuery code to fetch thumbnail of youtube video. This is very helpful when you are embedding any youtube video to your webpage. Youtube provides an API which can be used to fetch the thumbnail image of the video and not lot of people are aware about this. For the demo purpose, […]
Read the rest of this entry »