elementReady: a jQuery plugin

These are some readers' responses. Read the full article to see what all the fuss is about.

27 responses

Other comment pages: [1] 2 »

  • Wow

    I just realised today that I need this functionality. So I did a google search and found this.

    Then I wonder why there’s no comments for such a cool thing - I check the date and it was posted today !! What great timing : )

    I’ll give it a go now …

    weepy

    *…(

    weepy | 15 September 2007
  • Very Nice function, surprised that this was not included in jquery to begin with — brilliant :).

    Robert | 10 October 2007
  • If you think this should be part of jQuery, you can rate it on the jQuery site:
    http://jquery.com/plugins/project/elementReady

    If enough people use the plugin and rate it highly then it may eventually be included in the jQuery core. Spread the word!

    Bennett | 10 October 2007
  • What is difference between your plugin and jQuery .ready() function. I think that each methods doing the same result. I can write:
    $j(’element’).ready(function);

    zysio | 9 November 2007
  • Zysio, $('id').ready(function) doesn’t do what you think it does. Actually the ‘id’ is pretty much ignored — it’s equivalent to $(document).ready(function). In other words, the function is not called until the entire document has been loaded. That’s why you need to use $.elementReady('id', function): then the function gets called as soon as the element is loaded, even if the document is not completely loaded.

    This makes sense when you think about it: if the element whose id is ‘id’ has not yet been loaded, then $('id') contains no elements. Therefore, if ready applied to individual elements then $('id').ready(function) would have no effect.

    Bennett | 11 November 2007
  • Note there was a bug in the original version of elementReady that I posted here. It could cause some elementReady events not to fire if you called elementReady more than once on a page. I have fixed the bug and updated to version 0.5.

    Bennett | 11 November 2007
  • Maybe a dumb question: how can I check to see if two ID’s have been loaded? I need to run a function after two iFrames have been loaded and I don’t think it’s the same as chaining multiple calls…or maybe it is.

    Any help is appreciated.

    Lee | 14 November 2007

Other comment pages: [1] 2 »

Post your comment | RSS feed for comments
Close
E-mail It