Chris Domigan schrieb: > Josh, > > Using .load() within the scope of $(document).ready() is redundant, > since everything in that block is performed on page load anyway. > Also (1) you can use the :checked selector, and (2) this.value will work > just fine and saves the jquery call.
I'd like to add, that the load method is a little ambiguos. If you call it on a selection of elements, like: $('#output').load('/ajax.php'); it will load content from the given URL, and replace the contents of the matched elements with the response from that XmlHttpRequest request. A form element does not have a load event, thus you cannot bind that event to it. If you use load with the global window object on the other hand $(window).load(function() { // do something on load }); you will attach an event handler that gets executed when the page has been completely loaded, e.g. with all images etc. To avoid confusion I use $(window).bind('load', function() { / do something on load }); But usually you don't need that and use the "DOMContentLoaded" event to start acting on page elements. It gets fired earlier than the load event. This is done with the well known $(document).ready or its shortcut $(function() { // do something }); -- Klaus _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/