Answers
![Anpanman](https://data3.answerbase.com/answerbase/1720/UserFiles/User27949/profileImage27949.jpg?632891489730000000)
Oct 12, 2006 - 09:18 PM
![jgivoni](https://data3.answerbase.com/answerbase/1720/UserFiles/User27921/profileImage27921.jpg?632830506540000000)
Oct 13, 2006 - 11:45 AM
Now you could say that why don't I just include that line "init();" as the first one in the actual script?
Beacuse maybe I want to include the script without executing the init() in some cases.
Don't worry, there are plenty of other solutions, I just would like to know if anyone had knowledge about this specific issue.
I'll keep the question open...
![nhinds](https://data3.answerbase.com/answerbase/1720/Images/Avatars/avatar_01.jpg)
Oct 31, 2006 - 08:35 PM
if (window.addEventListener) window.addEventListener('load',init,false);
else if (document.addEventListener) document.addEventListener('load',init,false);
else if (window.attachEvent) window.attachEvent('onload',init);
else {//Older browsers only
if (typeof window. {
var oldload=window.onload;
window.
oldload();
init();
}
} else window.
}
![jgivoni](https://data3.answerbase.com/answerbase/1720/UserFiles/User27921/profileImage27921.jpg?632830506540000000)
Nov 05, 2006 - 10:04 PM
And another thing; at what point and how do you suggest to run the script you propose?
![nhinds](https://data3.answerbase.com/answerbase/1720/Images/Avatars/avatar_01.jpg)
Nov 06, 2006 - 05:44 PM
![jgivoni](https://data3.answerbase.com/answerbase/1720/UserFiles/User27921/profileImage27921.jpg?632830506540000000)
Nov 21, 2006 - 08:32 AM
if I put it in a script tag below the one that loads the script - wouldn't that just pollute the markup even more?
And if I put it inside the script itself, then I know that the script is already loaded, and I no longer need to attach any onload event to it!
Finally, my original question still stands uncommented:
Why doesn't the even fire - even though the documentation provided by the manufacturer states that it should?
I can see three posibilities so far:
1) I am reading the documentation wrong
2) I am reading the wrong documentation
3) It is a bug (may be limited to certain versions)
![haris](https://data3.answerbase.com/answerbase/1720/Images/Avatars/avatar_01.jpg)
Aug 19, 2007 - 09:35 PM
![uiqzfarkrypq](https://data3.answerbase.com/answerbase/1720/Images/Avatars/avatar_01.jpg)
Nov 24, 2008 - 08:48 AM
![cbeaujoin1](https://data3.answerbase.com/answerbase/1720/Images/Avatars/avatar_01.jpg)
Oct 12, 2009 - 08:25 AM
!
![Liao013](https://data3.answerbase.com/answerbase/1720/Images/Avatars/avatar_01.jpg)
Dec 29, 2010 - 12:46 AM
Add New Comment![Sending...](https://quomon.com/images/loading-boxes.gif)