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

Getting Netscape "Error: too many literals"

Status
Not open for further replies.

randall2nd

Programmer
May 30, 2001
112
US
I am trying to build some dynamic drop down menus, I load the javascript arrays first. Then when a user makes a selection the next ones in line are populated.

In IE 6.0 everything works fine, but in Netscape 7.0 the error "Error: too many literals" appears in the JavaScript console. I have narrowed the problem down to a piece of code that is loading a list of strings into a 5 dimension Array.

The code looks like this
Book_Name[j][k][x]= new Array("element1","element2","element3","element4","element5","element6","element7","element8",etc...);
Book_Number[j][k][x]= new Array("1","2","3","4","5","6","7","8",etc...);

When I hardcode the array elements, it works fine. But when I load them through ColdFusion(CF) I get the error above. I am 90% sure the code from CF is functioning properly. Is there a maximum number of elements a document can have?

I have tested the CF code from every angle I can think of, and no one record will break it. I can get it to break consistantly by limiting the number of loops over the array, but it will load passed that point if I start it later or comment out one of the arrays, then it breaks consitantly at a later point. (Plus like I said it works great in IE)

Any Ideas on:
What is causing Netsacpe to break when I go to load the arrays?
What the error means?
How to fix it?

Randall2nd
 
I don't think that the problem is the maximum number of elements in the document. I am guessing that NetScape is having a problem with your 5 dimension array.

I have done similar with another option - dynamic array names useing server side code..

arrA = new Array("element1","element2","element3")
arrB = new Array("element1","element2","element3")
arrC = new Array("element1","element2","element3")

controlArr = new Array ("A","B","C")


for (x=0; x<contolArr.length; x++){
for (y=0; y<eval(&quot;arr&quot; + contolArr[x] + &quot;.length&quot;; y++){
arrVal = eval(&quot;arr&quot; + contolArr[x])
}
}



Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Thanks for the input.

If it is the 5 dimension array issue, then why does it allow me to hard code elements into the 5 dimmension array, and to a certain point even put them dynamically?

Randall2nd
 
I tested out the 5 dimension thing. and that is not it. I combined the first two elements so that now I only have to use a 4 dimension element and it is still throwing the &quot;too many literals&quot; error.

Any other Ideas?
Is there a memory setting I could modify?

ANY help apreciated.

Randall2nd
 
I am 90% sure the code from CF is functioning properly.

Have you looked at the HTML your code outputs? Make sure...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
What should I be looking for?
The CF code generates well over 600 pages of HTML code!

The code works when I cut the loops short, so I am guessing that there may be some data in the database that is causing Netscape to see a problem.

What are the characters that could cause a problem?
I am removing all Quotes (double and single), slashes(forward and backward).

I also tested putting the data into the array one element at a time.

Book_Name[j][k][x]= new Array();
Book_Name[j][k][x].push(&quot;element1&quot;);
Book_Name[j][k][x].push(&quot;element2&quot;);
Book_Name[j][k][x].push(&quot;element3&quot;);

But I get the same error;


Randall2nd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top