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

Dreamweaver Preload Code

Status
Not open for further replies.

etelford

Programmer
Nov 2, 2003
4
I'm curious to know what '#' means in this code. (You'll probably recognize this as Macromedia's preload code used in Dreamweaver)


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(&quot;#&quot;)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}}

Thanks!

Erik
 
>> I'm curious to know what '#' means in this code.

# means just that - the '#' character.

In this instance,
Code:
a[i]
is being searched for the '#' character, and if found, a new image is created with the src being set to whatever is contained in
Code:
a[i]
(at least I'm 99% sure that's what is happening - it's hard to tell when people don't post code in
Code:
[
Code:
code]
tags, and half their code gets removed).

Hope this helps,

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top