Jump to content


Photo

window.onload problem! argh!!


  • Please log in to reply
5 replies to this topic

#1 mmosel

mmosel
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 16 February 2006 - 05:34 AM

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.

?????

#2 ChrisDarl

ChrisDarl
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 16 February 2006 - 07:50 PM

And you've set it out like the code bellow?

window.onload = function()
{

[JavaScript Code to run on load]
};

Chris

#3 mmosel

mmosel
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 16 February 2006 - 10:49 PM

[!--quoteo(post=346489:date=Feb 16 2006, 02:50 PM:name=ChrisDarl)--][div class=\'quotetop\']QUOTE(ChrisDarl @ Feb 16 2006, 02:50 PM) View Post[/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!

#4 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 17 February 2006 - 02:26 PM

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

function load(){

executeotherfunction();

};

window.onload = load();

Remove the "()" after load.
window.onload = load;


#5 ChrisDarl

ChrisDarl
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 17 February 2006 - 09:02 PM

The code that i put works, you can put whatever code you like betwee n the { } be it running another function or not.

#6 mmosel

mmosel
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 17 February 2006 - 09:27 PM

[!--quoteo(post=346875:date=Feb 17 2006, 04:02 PM:name=ChrisDarl)--][div class=\'quotetop\']QUOTE(ChrisDarl @ Feb 17 2006, 04:02 PM) View Post[/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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users