...

View Full Version : Prototype code, generating error



Sleeping_Troll
05-24-2009, 12:44 AM
This line of code:

var Orb[i]=new Element("img",{src:"../images/Orb.png"}).update("container");

Results in this firebug error:

missing ; before statement
var Orb[i]=new Element("img",{src:"../images/Orb.png"}).update("container");\n

container is a <div>

I have gotten to the sit and stare point on this, what am I not seeing?

venegal
05-24-2009, 01:15 AM
You can't initialize an array like that. It has to be something like

var Orb = [];
Orb[i]=new Element("img",{src:"../images/Orb.png"}).update("container");

Sleeping_Troll
05-24-2009, 03:31 AM
You are absolutely correct! now about my new problem...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum