Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4015680
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:38:55+00:00 2026-05-20T09:38:55+00:00

I am creating a huge Array in javascript…It’s 4 levels deep and many elements

  • 0

I am creating a huge Array in javascript…It’s 4 levels deep and many elements long. I create it at runtime w/ php so that everything on the page runs smoothly and no queries need to be done.

However, right now, I have some sort of problem with the Array and my html file isn’t seeing the javascript functions that are listed after the Array. With testing I’ve made the array shorter and gotten it to work, but for the life of me I can’t figure out why it’s cutting off the rest of the script in it’s full form.

I would appreciate any answers that either tell me
A. How to use Firebug to find the problem (I’m very new to Firebug)
or
B. Tell me what the #$%^ the problem is!

I’ll list my entire script below (the output from the php). The Array that’s having trouble is “inventoryNames”. I’ve checked to see if the problem is the amount of parantheses but I’m 99% positive it is now. If I comment it out everything works fine. Thanks

<script type="text/javascript">

var inventoryNames = 
        Array(
            Array(
                Array(
                    Array("AC/DC", "Back in Black", "36", "VG++", "12", ""), 
                    Array("AC/DC", "Back in Black", "37", "VG", "8", "")
                ), 
                Array(
                    Array("AC/DC", "Highway to Hell", "30", "VG++", "10", ""), 
                    Array("AC/DC", "Highway to Hell", "38", "VG", "5", ""), 
                    Array("AC/DC", "Highway to Hell", "35", "NM", "16", ""), 
                    Array("AC/DC", "Highway to Hell", "39", "NM", "14", "")
                )
            ), 
            Array(
                Array(
                    Array("Al Green", "Call Me", "40", "G", "5", ""), 
                    Array("Al Green", "Call Me", "31", "NM", "15", "")
                ), 
                Array(
                    Array("Al Green", "Let's Stay Together", "32", "NM", "12", ""), 
                    Array("Al Green", "Let's Stay Together", "33", "VG++", "10", ""), 
                    Array("Al Green", "Let's Stay Together", "34", "VG", "8", "")
                )
            ), 
            Array(
                Array(
                    Array("B.B. King", "Confessin' the Blues", "45", "VG++", "9", ""), 
                    Array("B.B. King", "Confessin' the Blues", "42", "NM", "35", "")
                ), 
                Array(
                    Array("B.B. King", "Lucille", "43", "VG++", "14", "")
                ), 
                Array(
                    Array("B.B. King", "Singin' the Blues", "41", "NM", "16", "")
                ), 
                Array(
                    Array("B.B. King", "Sings Spirituals", "44", "VG++", "10", "")
                )
            ), 
            Array(
                Array(
                    Array("Bad Company", "Bad Company", "12", "G", "2", ""), 
                    Array("Bad Company", "Bad Company", "13", "M", "38", "1st Edition"), 
                    Array("Bad Company", "Bad Company", "14", "VG+", "8", ""), 
                    Array("Bad Company", "Bad Company", "3", "VG++", "13", "")
                )
            ), 
            Array(
                Array(
                    Array("Bob Dylan", "Another Side of Bob Dylan", "48", "VG++", "20", "")
                ), 
                Array(
                    Array("Bob Dylan", "Blonde on Blonde", "50", "M", "35", "")
                ), 
                Array(
                    Array("Bob Dylan", "Highway 61 Revisited", "49", "NM", "25", "")
                ), 
                Array(
                    Array("Bob Dylan", "The Freewheelin' Bob Dylan", "46", "VG++", "13", "")
                ), 
                Array(
                    Array("Bob Dylan", "The Times They Are A-Changin'", "47", "NM", "25", "")
                )
            ), 
            Array(
                Array(
                    Array("Boston", "Boston", "52", "VG++", "12", ""), 
                    Array("Boston", "Boston", "53", "VG++", "10", ""), 
                    Array("Boston", "Boston", "51", "VG", "7", ""), 
                    Array("Boston", "Boston", "23", "VG", "6", "")
                )
            ), 
            Array(
                Array(
                    Array("Charlie Parker", "Jazz at Massey Hall", "54", "NM", "42", "")
                )
            ), 
            Array(
                Array(
                    Array("Creedence Clearwater Revival", "Green River", "56", "VG++", "13", ""), 
                    Array("Creedence Clearwater Revival", "Green River", "57", "NM", "16", ""), 
                    Array("Creedence Clearwater Revival", "Green River", "55", "VG+", "10", "")
                ), 
                Array(
                    Array("Creedence Clearwater Revival", "Willy and the Poor Boys", "60", "NM", "15", ""), 
                    Array("Creedence Clearwater Revival", "Willy and the Poor Boys", "114", "NM", "16", ""), 
                    Array("Creedence Clearwater Revival", "Willy and the Poor Boys", "58", "G", "5", ""), 
                    Array("Creedence Clearwater Revival", "Willy and the Poor Boys", "59", "VG", "7", "")
                )
            ), 
            Array(
                Array(
                    Array("Dave Brubeck", "Time Out", "61", "NM", "18", ""), 
                    Array("Dave Brubeck", "Time Out", "62", "VG+", "10", "")
                )
            ), 
            Array(
                Array(
                    Array("David Allan Coe", "Longhaired Redneck", "63", "VG+", "8", "")
                ), 
                Array(
                    Array("David Allan Coe", "Rides Again", "64", "VG+", "6", ""), 
                    Array("David Allan Coe", "Rides Again", "65", "NM", "10", "")
                )
            ), 
            Array(
                Array(
                    Array("David Bowie", "Hunky Dory", "18", "NM", "40", "Rare!")
                ), 
                Array(
                    Array("David Bowie", "Ziggy Stardust and the Spiders From Mars", "21", "VG++", "15", "")
                )
            ), 
            Array(
                Array(
                    Array("Earth, Wind & Fire", "Earth, Wind & Fire", "67", "VG+", "10", "")
                ), 
                Array(
                    Array("Earth, Wind & Fire", "That's the Way of the World", "66", "NM", "15", "")
                )
            ), 
            Array(
                Array(
                    Array("Foghat", "Energized", "68", "NM", "10", ""), 
                    Array("Foghat", "Energized", "2", "M", "2", "")
                )
            ), 
            Array(
                Array(
                    Array("George Harrison", "All Things Must Pass", "69", "NM", "35", ""), 
                    Array("George Harrison", "All Things Must Pass", "1", "M", "2", "")
                )
            ), 
            Array(
                Array(
                    Array("Guns N Roses", "Appetite for Destruction", "70", "NM", "20", "")
                )
            ), 
            Array(
                Array(
                    Array("Hank Williams", "Hank Williams Sings", "29", "M", "55", ""), 
                    Array("Hank Williams", "Hank Williams Sings", "71", "NM", "70", "")
                )
            ), 
            Array(
                Array(
                    Array("Herbie Hancock", "Empyrean Isles", "72", "VG++", "10", "")
                ), 
                Array(
                    Array("Herbie Hancock", "Head Hunters", "74", "VG++", "13", "")
                ), 
                Array(
                    Array("Herbie Hancock", "Maiden Voyahe", "73", "VG++", "13", "")
                )
            ), 
            Array(
                Array(
                    Array("Huey Lewis & the News", "Sports", "76", "VG+", "3", ""), 
                    Array("Huey Lewis & the News", "Sports", "77", "VG", "2", ""), 
                    Array("Huey Lewis & the News", "Sports", "75", "NM", "8", "")
                )
            ), 
            Array(
                Array(
                    Array("Its a Beautiful Day", "Its a Beautiful Day", "20", "VG++", "10", "")
                )
            ), 
            Array(
                Array(
                    Array("James Brown", "Prisoner of Love", "78", "VG++", "18", "")
                )
            ), 
            Array(
                Array(
                    Array("Jimi Hendrix", "Are You Experienced", "22", "VG+", "12", "")
                )
            ), 
            Array(
                Array(
                    Array("John Lee Hooker", "John Lee Hooker Plays and Sings the Blues", "81", "VG++", "15", "")
                ), 
                Array(
                    Array("John Lee Hooker", "Travelin'", "80", "VG++", "15", ""), 
                    Array("John Lee Hooker", "Travelin'", "82", "VG+", "15", ""), 
                    Array("John Lee Hooker", "Travelin'", "79", "VG++", "20", "")
                )
            ), 
            Array(
                Array(
                    Array("Mazaak", "Fat Man Suicide", "25", "M", "200", "Includes classics like "Cream Green and Beans" and the title track "Fat Man Suicide"!")
                )
            ), 
            Array(
                Array(
                    Array("Miles Davis", "Bitches Brew", "85", "NM", "30", "")
                ), 
                Array(
                    Array("Miles Davis", "Kind of Blue", "84", "VG+", "15", ""), 
                    Array("Miles Davis", "Kind of Blue", "83", "VG", "10", "")
                ), 
                Array(
                    Array("Miles Davis", "Miles Ahead", "87", "NM", "15", "")
                ), 
                Array(
                    Array("Miles Davis", "Round About Midnight", "86", "NM", "45", "")
                ), 
                Array(
                    Array("Miles Davis", "Star People", "88", "M", "15", "")
                )
            ), 
            Array(
                Array(
                    Array("Motley Crue", "Theatre of Pain", "4", "VG", "5", ""), 
                    Array("Motley Crue", "Theatre of Pain", "16", "VG", "5", "")
                )
            ), 
            Array(
                Array(
                    Array("Muddy Waters", "At Newport", "89", "VG+", "10", "")
                ), 
                Array(
                    Array("Muddy Waters", "Hard Again", "90", "VG++", "15", "")
                )
            ), 
            Array(
                Array(
                    Array("Otis Redding", "In Person at the Whisky a Go Go", "28", "VG++", "20", "")
                ), 
                Array(
                    Array("Otis Redding", "Otis Blue", "92", "VG+", "12", "")
                ), 
                Array(
                    Array("Otis Redding", "The Dock of the Bay", "91", "VG++", "20", "")
                )
            ), 
            Array(
                Array(
                    Array("Ozzy Osbourne", "Bark at the Moon", "95", "VG++", "15", "")
                ), 
                Array(
                    Array("Ozzy Osbourne", "Blizzard of Ozz", "93", "VG++", "10", ""), 
                    Array("Ozzy Osbourne", "Blizzard of Ozz", "94", "VG++", "12", "")
                )
            ), 
            Array(
                Array(
                    Array("Parliament", "Mothership Connection", "96", "VG", "8", "")
                ), 
                Array(
                    Array("Parliament", "Motor Booty Affair", "97", "NM", "12", "")
                )
            ), 
            Array(
                Array(
                    Array("Pink Floyd", "Wish You Were Here", "15", "NM", "17", "")
                )
            ), 
            Array(
                Array(
                    Array("Sly & the Family Stone", "Stand!", "100", "NM", "20", ""), 
                    Array("Sly & the Family Stone", "Stand!", "98", "VG", "8", ""), 
                    Array("Sly & the Family Stone", "Stand!", "99", "VG++", "15", "")
                )
            ), 
            Array(
                Array(
                    Array("Taj Mahal", "Giant Step", "6", "VG+", "13", ""), 
                    Array("Taj Mahal", "Giant Step", "19", "VG+", "10", "")
                )
            ), 
            Array(
                Array(
                    Array("Talking Heads", "Remain in Light", "101", "VG++", "15", ""), 
                    Array("Talking Heads", "Remain in Light", "102", "VG+", "10", ""), 
                    Array("Talking Heads", "Remain in Light", "103", "NM", "20", "")
                ), 
                Array(
                    Array("Talking Heads", "Talking Heads 77", "104", "NM", "25", "")
                )
            ), 
            Array(
                Array(
                    Array("The Allman Brothers Band", "At Fillmore East", "105", "VG++", "15", ""), 
                    Array("The Allman Brothers Band", "At Fillmore East", "106", "VG++", "15", ""), 
                    Array("The Allman Brothers Band", "At Fillmore East", "11", "NM", "16", "")
                ), 
                Array(
                    Array("The Allman Brothers Band", "Eat a Peach", "8", "G", "3", ""), 
                    Array("The Allman Brothers Band", "Eat a Peach", "9", "VG", "8", ""), 
                    Array("The Allman Brothers Band", "Eat a Peach", "10", "M", "20", "")
                )
            ), 
            Array(
                Array(
                    Array("The Beatles", "Rubber Soul", "24", "M", "1.93", "")
                ), 
                Array(
                    Array("The Beatles", "Sgt. Pepper's Lonely Hearts Club Band", "5", "VG+", "15", ""), 
                    Array("The Beatles", "Sgt. Pepper's Lonely Hearts Club Band", "27", "VG++", "20", "")
                )
            ), 
            Array(
                Array(
                    Array("The Mothers of Invention", "Freak Out!", "17", "NM", "20", "")
                )
            ), 
            Array(
                Array(
                    Array("The Rolling Stones", "Exile on Main Street", "107", "NM", "25", "")
                ), 
                Array(
                    Array("The Rolling Stones", "Let It Bleed", "7", "M", "12", "")
                )
            ), 
            Array(
                Array(
                    Array("Thelonious Monk", "Brilliant Corners", "108", "VG++", "30", ""), 
                    Array("Thelonious Monk", "Brilliant Corners", "109", "M", "60", "")
                ), 
                Array(
                    Array("Thelonious Monk", "Monk's Dream", "110", "VG++", "19", ""), 
                    Array("Thelonious Monk", "Monk's Dream", "26", "NM", "35", "")
                )
            ), 
            Array(
                Array(
                    Array("Willie Nelson", "Phases and Stages", "113", "VG++", "12", "")
                ), 
                Array(
                    Array("Willie Nelson", "Red Headed Stranger", "112", "VG++", "11", ""), 
                    Array("Willie Nelson", "Red Headed Stranger", "111", "VG++", "10", "")
                )
            )
        );











var albumNames = Array(Array("Highway to Hell", "Back in Black"), Array("Call Me", "Let's Stay Together"), Array("Singin' the Blues", "Confessin' the Blues", "Sings Spirituals", "Lucille", "Live at the Regal"), Array("Bad Company"), Array("The Freewheelin' Bob Dylan", "The Times They Are A-Changin'", "Another Side of Bob Dylan", "Bringing It All Back Home", "Highway 61 Revisited", "Blonde on Blonde", "John Wesley Harding", "Nashville Skyline", "Self Portrait", "New Morning", "Blood on the Tracks"), Array("Boston"), Array("Jazz at Massey Hall"), Array("Green River", "Cosmos Factory", "Willy and the Poor Boys"), Array("Time Out", "The Dave Brubeck Quartet at Carnegie Hall"), Array("Longhaired Redneck", "Rides Again"), Array("Ziggy Stardust and the Spiders From Mars", "Hunky Dory"), Array("That's the Way of the World", "Earth, Wind & Fire"), Array("Energized"), Array("All Things Must Pass"), Array("Appetite for Destruction"), Array("Hank Williams Sings"), Array("Empyrean Isles", "Maiden Voyahe", "Head Hunters", "Sextant", "Crossings"), Array("Sports", "Picture This"), Array("Its a Beautiful Day"), Array("Prisoner of Love"), Array("Are You Experienced"), Array("Travelin'", "John Lee Hooker Plays and Sings the Blues"), Array("Fat Man Suicide"), Array("Round About Midnight", "Miles Ahead", "Kind of Blue", "Bitches Brew", "Star People"), Array("Theatre of Pain"), Array("At Newport", "Folk Singer", "Brass and the Blues", "Hard Again"), Array("The Dock of the Bay", "Otis Blue", "In Person at the Whisky a Go Go"), Array("Blizzard of Ozz", "Bark at the Moon"), Array("Mothership Connection", "Motor Booty Affair"), Array("Wish You Were Here"), Array("Look What the Cat Dragged In"), Array("The Genius of Ray Charles", "Modern Sounds in Country and Western Music", "The Genius Sings the Blues"), Array("Stand!", "Fresh"), Array("Giant Step", "Taj Mahal", "Happy Just to Be Like I Am", "Music Keeps Me Together"), Array("Remain in Light", "Talking Heads 77", "Speaking in Tongues"), Array("Eat a Peach", "At Fillmore East"), Array("Please Please Me", "A Hard Day's Night", "Help!", "Rubber Soul", "Revolver", "Sgt. Pepper's Lonely Hearts Club Band", "Magical Mystery Tour", "The Beatles (White Album)", "Abbey Road", "Let It Be"), Array("Freak Out!"), Array("Exile on Main Street", "Big Hits (High Tide and Green Grass)", "Let It Bleed"), Array("Brilliant Corners", "Evidence", "Monk's Dream"), Array("Red Headed Stranger", "Yesterday's Wine", "Phases and Stages", "The Sound in Your Mind"));

function byId(id){
      return document.getElementById ?  document.getElementById(id) : document.all[id];
    }
    function populateAlbums(index) {
      var i = byId('albumSelect').options.length;
      for (; i>=0; i--) {
          byId('albumSelect').remove(i);
      }

      var artistAlbums = albumNames[index];
      for (i = 0; i < artistAlbums.length; i++) {
        var option = document.createElement('option');
        option.text = artistAlbums[i];
        option.value = artistAlbums[i];
        try      { byId('albumSelect').add(option, null); } // non-IE
        catch(e) { byId('albumSelect').add(option); } // IE
      }
    }
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:38:55+00:00Added an answer on May 20, 2026 at 9:38 am

    One of your strings contains double-quotes:

    Array("Mazaak", "Fat Man Suicide", "25", "M", "200", "Includes classics like "Cream Green and Beans" and the title track "Fat Man Suicide"!")
    

    You can escape them with black-slashes

    Array("Mazaak", "Fat Man Suicide", "25", "M", "200", "Includes classics like \"Cream Green and Beans\" and the title track \"Fat Man Suicide\"!")
    

    or use single-quotes around the string

    Array("Mazaak", "Fat Man Suicide", "25", "M", "200", 'Includes classics like "Cream Green and Beans" and the title track "Fat Man Suicide"!')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While creating classes in Java I often find myself creating instance-level collections that I
i need help with creating a regex for putting all values into an array!
I had a huge file for creating this GUI and I have shortened it
I'm creating a Java app that creates 4 PDF files using iText. On the
Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups.
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
Creating an XPathDocument with referenced DTD sometimes throws a web exception. Why?
When creating a web application, and lets say you have a User object denoting
While creating a file synchronization program in C# I tried to make a method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.