Rob Desbois 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();

    });


I might be missing something here but why not just use the <noscript> tag?


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

I'm far from knowing all the facts but I thought .ready() was just a jquery event for 'onload', for whatever element just loaded. Like .bind('onload', function(){ ... } );, Is that right?

Rob

Reply via email to