Jump to content

window.onload problem! argh!!


mmosel

Recommended Posts

[!--quoteo(post=346489:date=Feb 16 2006, 02:50 PM:name=ChrisDarl)--][div class=\'quotetop\']QUOTE(ChrisDarl @ Feb 16 2006, 02:50 PM) [snapback]346489[/snapback][/div][div class=\'quotemain\'][!--quotec--]
And you've set it out like the code bellow?

window.onload = function()
{

[JavaScript Code to run on load]
};

Chris
[/quote]


Well, I had been using this method, perhaps this was wrong?

function load(){

executeotherfunction();

};

window.onload = load();

then, I found this and tried it:

function loadmeup(){
executeotherfunction();
};

var OnLoad = 'loadmeup()';

window.onload = function() {eval(OnLoad);};

and it seems to work in IE. I haven't had a problem with Firefox.

I'll try it the other way and see what happens, thanks!
[!--quoteo(post=346875:date=Feb 17 2006, 04:02 PM:name=ChrisDarl)--][div class=\'quotetop\']QUOTE(ChrisDarl @ Feb 17 2006, 04:02 PM) [snapback]346875[/snapback][/div][div class=\'quotemain\'][!--quotec--]
The code that i put works, you can put whatever code you like betwee n the { } be it running another function or not.
[/quote]

Thanks both of you. I'll try out both or your suggestions and see how it goes.

Cheers.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.