Skipping a form end tag </form> costed me almost a day (i had to go to bed abandoning the fixing for some time though;)). I had been using ajaxForm with jQuery to submit ajax form which was placed on a…
Category: Javascript
Fix to jQuery plugin does not work on ajax loaded content
I had been loading table records through ajax pagination using jquery. Some of the urls/links (View Details, Edit and Delete) in loaded content had been using thickbox to handle respective requests. Although, if i did’t use the ajax to load…
Javascript common mistake of comparing with NaN and not with isNaN
Recently, i fell into the trap of NaN and isNaN and it turned me pulling my hair for quite a few good minutes. Thats why i decided to make a note of it here for a recitation and as a…
Gmail like ajax loading message at the top of page
Here is a sample javascript code to show Gmail like “Loading.. Please wait..” message at the top of a HTML page while making Ajax requests. Irrespective of the position of Ajax links within web page, the “Loading” message will show…
Autocomplete=”off” workaround / fix for valid XHTML
Add an onload function similar to the following to <head> section of your web page. <script type=”text/javascript”> function onload_call() { if (!document.getElementById) return false; var f = document.getElementById(‘field_name’); f.setAttribute(“autocomplete”, “off”); } </script>
Checking / Unchecking radio buttons and retrieving their value in jQuery
Let us assume we have radio buttons <input name=”rd_name” id=”RD1″ value=”Value One” /> Label 1 <input name=”rd_name” id=”RD2″ value=”Value Two” /> Label 2 To retrieve and set radio button values by id we have the following methods. To retrieve we…
Invoking Lightbox2 slide show on page load
Invoke Lightbox2 on page load? Good question! If you have got frustrated searching for a solution to it, relax, it’s here! Just place the following snippet of javascript code in your web page’s <head> section:
Browser detect script in javascript
I found this useful and up-to-date article to detect browser in JavaScript. Please refer to the author’s site page for detailed explanation.
When Firebug made life easier
It’s been around three years now i have been using the Firebug. This great tool provides a web developer an easy way to look at and inspect the source code of a web page. You can view and experiment with…
How to position a pop up element on mouse position coordinates with jquery
Here is a simple yet useful trick to position a tooltip (a div element etc) near the mouse click or pointer position using jQuery. In the example here, we have a tool tip (div) with id “tooltip”, a href tag,…