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.
Try this:
$(document).ready(function() {
-
From: Chris Domigan
To: jQuery Discussion.
Sent: Thursday, March 01, 2007 9:52 AM
Subject: Re: [jQuery] Load method help
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
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,
$() effectively returns an pseudo-array of the elements that match the
specified query. The .each() method applies a function to each element in
that array. In your case the query matches only one element in the DOM, so
there is only one element in the array, and .each() will be performed once.