Jump to content

Archived

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

mmosel

window.onload problem! argh!!

Recommended Posts

Help!!

Argh!

Things are going along just fine, until I start getting this error in IE while using a window.onload = function();


I get this error 'not implemented'. The strange thing is that the function still executes, but I get this error and I can't get rid of it.

?????

Share this post


Link to post
Share on other sites
And you've set it out like the code bellow?

window.onload = function()
{

[JavaScript Code to run on load]
};

Chris

Share this post


Link to post
Share on other sites
[!--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!

Share this post


Link to post
Share on other sites
[quote]
Well, I had been using this method, perhaps this was wrong?

function load(){

executeotherfunction();

};

window.onload = load();
[/quote]
Remove the "()" after load.
[code]
window.onload = load;
[/code]

Share this post


Link to post
Share on other sites
The code that i put works, you can put whatever code you like betwee n the { } be it running another function or not.

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
Share on other sites

×

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.