Search code examples
jqueryjquery-templates

Problems with JQuery Templates on document.load


I am sure what this really means is that I don't understand the order of events in Javascript

Can anyone explain why one of these works and the other does not?

$(document).load() (does not work) http://jsfiddle.net/KGabbert/E6SxL/3/

$(document).ready() (works) http://jsfiddle.net/KGabbert/E6SxL/2/

(you should see 3 buttons on each page)


Solution

  • It should be $(window).load, not $(document).load

    $(window).load(function() {
    });
    

    Change that and it works.