All jQuery Codes

Detect IE11 using JavaScript/jQuery

In this post, find JavaScript/jQuery code to detect IE 11. Your old code detect IE browser either using navigator.userAgent or $.browser.msie will not work for IE 11 as the User Agent string for IE 11 is changed. Previously I had posted about Detect Browsers using jQuery, but with the release of jQuery 1.9 $.browser feature […]
Read the rest of this entry »

jQuery on() – Click event not working for dynamically added element

My colleague got stuck into a problem where he was using jQuery on() method to attach the click event handlers but click event was not working for dynamically added elements. Although he knew that .bind() method doesn't work for dynamically added element but he was quite sure about .live() and .on(). Since .live() method is […]
Read the rest of this entry »

Export table to Excel using jQuery in IE

Previously I had posted about Export table data to Excel using jQuery but that solution doesn't work in IE. And many of us are looking for solution to this problem. If you are using ASP.NET, then by end of this post you will have the solution. To make it work for IE with ASP.NET, we […]
Read the rest of this entry »

jQuery: Convert ASP.NET GridView Data into CSV

In this post, find jQuery code to convert ASP.NET GridView data into CSV format which is sometimes quite useful for exporting purpose. This can be also be done using server side code but that involves extra overhead "postback". ASP.NET GridView control is rendered in table > th > tr > td format. The columns names […]
Read the rest of this entry »

How to restore CSS styles using jQuery

To assign inline css to any DOM element, we can jQuery ".css()" method to define it. Like, $("#dvText").css('color','#FF0000'); And if you need to remove the color again, then you can use the same css method to remove it. Like, $("#dvText").css('color',''); The above method to remove/restore the style is fine, when you have defined a single […]
Read the rest of this entry »

Fix for ASP.NET Checkbox -jQuery click event getting fired twice issue

This is really interesting. If ASP.NET checkboxes or checkbox list is placed within any container element like div or span, and click event is attached on checkbox. And then clicking on checkbox text will call click event twice. For example, consider the following HTML/ASP.NET code. <div id="dvList"> <asp:CheckBox ID="chk1" runat="server" Text="Check1" CssClass="Dummy" /> <asp:CheckBox ID="chk2" […]
Read the rest of this entry »