Aha ok, thanks Mike. --rob
On 6/8/07, Mike Alsup <[EMAIL PROTECTED]> wrote:
You can call ready on anything you want, but the fn will only run when the document is ready. So what you have is no different than $(document).ready(). Mike On 6/8/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > Is $(document) the only thing that .ready(..) should be applied to? > > When a page has a form on it with an item which should logically have the > focus by default, I like to bung in some JS to focus on that element ASAP. > > It's not necessary for the entire DOM to be ready to do that, only the > textbox. > The following code works but I just want someone to tell me whether I'm > being dumb or not ;-) > > $("#noJavascriptWarning").ready(function() { > > $("#noJavascriptWarning").hide(); > > > > > > }); > > > > Additionally, if that is a sensible thing to do can I get the jQuery/DOM > object in the function or do I have to select it again? > The 'this' in the function is a Document object, hence me thinking .ready() > perhaps shouldn't be applied to anything but $(document). > > TIA, happy nearly weekend all :-) > --rob > > > -- > Rob Desbois > Eml: [EMAIL PROTECTED] > "There's a whale there's a whale there's a whale fish" he cried, and the > whale was in full view. > ...Then ooh welcome. Ahhh. Ooh mug welcome.