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
the window.onload event fires when all external dependencies (such as
images) have loaded. You can bind events to it with:
$(window).load(function() {
alert('Everything is loaded!');
});
Is that what you're looking for?
--Erik
On 6/23/07, howa [EMAIL PROTECTED] wrote:
Hello,
is it
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
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!');
});
Hi Howa,
Try jQuery(window) without the quotes around window. That should do
it! :)
--Karl
_
Karl Swedberg
www.englishrules.com
www.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
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
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
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
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
9 matches
Mail list logo