|
Re: [jQuery] $(document).load() and friends: msg#01148lang.javascript.jquery
Mika Tuupola wrote: > Am I missing something obvious or why does .load() not seem to > trigger anything. I am sure $('img').load(function() { something }); > used to work before. This is not the case with 1.0.2. > > Check the page below. I get only "ready" at firebug console. So none > of the load()'s get executed. > > http://www.appelsiini.net/~tuupola/jquery/panview/load.html > > -cut- > $(document).ready(function() { > console.log('ready'); > }); > $('img').load(function() { > console.log('img load'); > }); > $('p').load(function() { > console.log('p load'); > }); > $(document).load(function() { > console.log('document load'); > }); > -cut- > $('img') and $('p') won't find anything until the document is ready, try: $(document).ready(function() { console.log('ready'); $('img').load(function() { console.log('img load'); }); $('p').load(function() { console.log('p load'); }); }); I'm not sure about $(document).load though, never used it! - Mark Gibson
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [jQuery] Ajax to update multiple fields, Sean O |
|---|---|
| Next by Date: | [jQuery] jQuery image gallery, Webunity | Gilles van den Hoven |
| Previous by Thread: | [jQuery] $(document).load() and friends, Mika Tuupola |
| Next by Thread: | Re: [jQuery] $(document).load() and friends, Dave Methvin |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |