jQuery offers two powerful methods to execute code and attach event handlers: $(document).ready and $(window).load. The document ready event executes already when the HTML-Document is loaded and the DOM is ready, even if all the graphics haven’t loaded yet. If you want to hook up your events for certain elements before the window loads, then [...]
Posts Tagged ‘jQuery’
$(document).ready vs. $(window).load
Posted in javascript, tagged javascript, jQuery on April 28, 2009 | 3 Comments »
jQuery logging in Firebug
Posted in development, javascript, tagged javascript, jQuery on April 18, 2009 | Leave a Comment »
The Firebug plugin for Firefox is indispensable to debug and examine HTML pages. The Firebug Console executes jQuery expressions, too. It shows directly the effects of all Javascript and jQuery functions. The effects are immediately visible on the page, but the results it returns on the console are often less useful, because one can not [...]
A semicolon character is expected error
Posted in javascript, tagged ajax, javascript, jQuery on April 9, 2009 | Leave a Comment »
Let us consider the following context: you have a dropdown selection box, and want do load specific content dynamically via Ajax for each entry of the box.
<select id=’box_id’>
<option value=’1′>One</option>
<option value=’2′>Two</option>
<option value=’3′>Three</option>
</select>
The following jQuery Ajax call looks ok and works in FireFox, but it doesn’t work for the Internet Explorer. [...]
Ajax with jQuery
Posted in javascript, tagged javascript, jQuery on December 25, 2008 | 2 Comments »
Loading stuff through Ajax-requests is simple with jQuery. The following code loads a remote page using an asnychronous XML HTTP request and replaces the content of the HTML tag with the ID “panel”:
jQuery("#panel").load("/items/"+id);
If you want to add more options, you can use the following notation:
jQuery.ajax({
[...]