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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expected ':' error on preloading image

Status
Not open for further replies.

jahchong

Programmer
Aug 10, 2003
18
0
0
MU
Helo

I have this function for preloading some images from dreamweaver:

function MM_preloadImages() { //v3.0
var d=document;
if(d.images)
{
if(!d.MM_p) d.MM_p=new Array();
var i,j,a;
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;
}
}
}
}

And I call the function in <body onload="MM_preloadImages(' ...)">

The thing is that it works when i open a new IE window and type the URL of the site in there. But when i send myself an email containing the link and i click on the link i get an error of "Expected ':'" on line
d.MM_p[j]=new Image;

Can someone help pls?
 
Dan,

no i get the same error. Can it be that there is some syntax error somewhere that i haven't spotted?

I've checked the URLs that are passed as arguments, and they are correct.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top