I take it all back! <script type="text/javascript"> $(function(){ eval($('body').attr('onload')); }); </script> </head> <body onload='alert("hi")'> ok </body>
alerted 2 times!! On 6/23/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:
yes... it overrides onload="test()" ... but it should still be in the dom, so you can still get at it! // untested jQuery(document).ready(function() { eval($('body').attr('onload')); }) 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.- 隱藏被引用文字 - > > > > - 顯示被引用文字 - > > -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
-- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ