Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    GŁtkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    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");

  • #3
    New Coder
    Join Date
    May 2009
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You are absolutely correct! now about my new problem...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •