yes i know....
but the problem is: sometimes, you don't have the control over the body tag, for example, you are writing a plugin require to trigger some things during window onload, you can't force your users not to use body onload="xxx" right? On 6月24日, 上午2時16分, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > Try this: > > <html> > <head> > <script src="jquery.js"></script> > <script> > function test() { > alert('test'); > > } > > $(document).ready(function() { > > }); > > // Assign event to window.onload > $(window).load(test); > </script> > </head> > <body> > TEST123 > </body> > </html> > > --Erik > > On 6/23/07, howa <[EMAIL PROTECTED]> wrote: > > > > > > > Thanks...but how to handle this? > > > <html> > > <head> > > > <script src="jquery.js"></script> > > > <script> > > jQuery(document).ready(function() { > > // Assign event to window.onload > > jQuery(window).load(function() { > > alert('Everything is loaded!'); > > }); > > }); > > > function test() { > > alert('test'); > > } > > > </script> > > > </head> > > <body onload="test();"> > > TEST123 > > </body> > > </html> > > > I don't want to override the original onload: test() > > > also... > > > why jQuery(body) or jQuery("body") didn't work? > > > thanks. > > > On 6月23日, 下午9時31分, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > > Hi Howa, > > > > Try jQuery(window) without the quotes around window. That should do > > > it! :) > > > > --Karl > > > _________________ > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > > > On Jun 23, 2007, at 9:20 AM, howa wrote: > > > > > Hello Gilles & Erik, the codes below never work with IE7 & FF2.0 > > > > > <html> > > > > <head> > > > > > <script src="jquery.js"></script> > > > > > <script> > > > > jQuery(document).ready(function() { > > > > alert('ready'); > > > > > // Assign event to window.onload > > > > jQuery('window').load(function() { > > > > alert('Everything is loaded!'); > > > > }); > > > > > }); > > > > > </script> > > > > > </head> > > > > <body> > > > > TEST123 > > > > </body> > > > > </html> > > > > > howa > > > > > On 6月23日, 下午7時09分, "Gilles (Webunity)" <[EMAIL PROTECTED]> > > > > wrote: > > > >> As i see your question, i think you mean this: > > > > >> jQuery(document).ready(function() { > > > >> // Assign event to window.onload > > > >> jQuery('body').load(function() { > > > >> alert('Everything is loaded!'); > > > >> }); > > > > >> }); > > > > >> On 23 jun, 12:52, howa <[EMAIL PROTECTED]> wrote: > > > > >>> Hello, > > > > >>> is it possible to attach some codes to the body.onload via > > > >>> document.ready, or other methods to attach body.onload? > > > > >>> thanks.- 隱藏被引用文字 - > > > > - 顯示被引用文字 -- 隱藏被引用文字 - > > - 顯示被引用文字 -