Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-24-2009, 12:44 AM   PM User | #1
Sleeping_Troll
New Coder

 
Join Date: May 2009
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Sleeping_Troll is an unknown quantity at this point
Prototype code, generating error

This line of code:
Code:
var Orb[i]=new Element("img",{src:"../images/Orb.png"}).update("container");
Results in this firebug error:
Code:
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?
Sleeping_Troll is offline   Reply With Quote
Old 05-24-2009, 01:15 AM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
You can't initialize an array like that. It has to be something like
Code:
var Orb = [];
Orb[i]=new Element("img",{src:"../images/Orb.png"}).update("container");
venegal is offline   Reply With Quote
Old 05-24-2009, 03:31 AM   PM User | #3
Sleeping_Troll
New Coder

 
Join Date: May 2009
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Sleeping_Troll is an unknown quantity at this point
You are absolutely correct! now about my new problem...
Sleeping_Troll is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:03 AM.


Advertisement
Log in to turn off these ads.