Check that there isn't a comma at the end of the last item in your
array. I had the same problem with autocomplete and it turned out that
I had a comma at the end of the last item due to an oversimplified
loop serverside to output the array.

IE

[ 'item', 'item', 'item', ] will break in IE but not FF etc.

you want

[ 'item', 'item', 'item ] notice no trailing ',' at the end of the
final item.


On Jul 1, 5:56 am, Gearóid O'Ceallaigh <[EMAIL PROTECTED]> wrote:
> Hi, thanks for the reply.
>
> I can't post the page since the site is being developed locally. I
> figured out several things that may prove useful however. I tried
> using a group of the data to see if this was the problem. IE6 returned
> the same error: "Unterminated String Contstant" but I noticed that the
> line it had a problem with had a German character ( ü ) in it. An
> element before this in the list also had this character but threw up
> no problem. The word in which the character is used was
> " (something)führer" so I rename all elements with the word führer and
> replaced them with "fuhrer". The smaller array now worked.
>
> I tried applying the same technique (as a stop gap) to the larger
> array but again IE6 was complaining about an "unterminated string
> constant". I then removed all cases of the character "ü" and replaced
> them with "u". Now IE has the error "Expected ']' " about halfway
> through the array. There is no syntax error around these lines - I've
> checked a few times.
>
> Is there a chance that these foreign characters are causing the errors
> within the script?
>
> On Jun 30, 3:59 pm, gf <[EMAIL PROTECTED]> wrote:
>
> > On Jun 30, 3:38 am, Gearóid O'Ceallaigh <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I'm using bassistance's autocomplete on a website (plugin page found
> > > here:http://plugins.jquery.com/project/autocompletex). Its perfect
> > > for I need since it allows the data for the autocomplete to be loaded
> > > from a local array. However, whilst the autocomplete works fine in
> > > most browsers - it seems that the length of the array is throwing up
> > > an error in IE6. The array contains maybe 500+ elements of data but
> > > even if I put them on a single line in the code, the error still gets
> > > thrown up.
>
> > > Has anyone else ever had this problem?
>
> > It's possible but not real likely that IE6 has a bug preventing it
> > from handling that many elements. Without seeing the error nobody can
> > say for sure.
>
> > Having programmed for a long-long time, my instinct is to say more
> > likely it's some sort of quoting or delimiting bug in the array
> > definition. With that many elements it's hard to scan through them by
> > eye unless you have laid them out in a very organized fashion. Our
> > eyes and brain are good at finding changes in a pattern of orderly
> > rows and columns, not at finding a missing comma or quote in pages of
> > characters. So, I always line my arrays up vertically into columns as
> > much as possible. (A programming editor like vim with the align module
> > makes it really easy.)
>
> > My next thought is I would use an Ajax query to reduce the array of
> > 500 down to something a lot more manageable. You don't say how big
> > each element is, but that many elements will slow page load and
> > rendering making your user's browser bog down a bit.
>
> > Do you have the offending page somewhere that others can see it so
> > they can try to figure out what's wrong? Don't post the code here as
> > it'll cause screams as people open up that many lines of code.

Reply via email to