Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with onload event (?)

Status
Not open for further replies.

FALCONSEYE

Programmer
Jul 30, 2004
1,158
US
I have the following:
Code:


function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}


then I use
Code:


function func1() {
alert("This is the first!");
}

function func2() {

alert("This is the second!");
}

function func3() {
MM_preloadImages('/navigation/shopsBT_f2.png','/navigation/restaurantBarBT_f2.png','/navigation/timeWarnerCenterBT_f2.png','/navigation/whatsHappeningBT_f2.png','/navigation/atYourServiceBT_f2.png')
}

addLoadEvent(func1);
addLoadEvent(func2);
addLoadEvent(func3);




MM_preloadImages is created by some application that makes navigation menus and it is as follows:

Code:

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}



Now the funky thing is everything works perfectly on FireFox. IE does not process func3() . Does anyone know what the heck is wrong with IE?
thanks

 
Thanks for looking into this. I solved the problem late last night. In the style sheet, there was a line with :
<!--

once I removed that line everything worked perfect.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top