0

Folks,

I have this array:

var list = new Array('Archer','Archer','Banker','Lantern','Toryboy','The Barb','Tim 
Whiffler','Glencoe','Warrior','Nimblefoot','The Pearl','The Quack','Don 
Juan','Haricot','Wollomai','Briseis','Chester','Calamia','Darriwell','Grand 
Flaneur','Zulu','The Assyrian','Martini-Henry','Malua','Sheet 
 Anchor','Arsenal','Dunlop','Mentor','Bravo','Carbine','Malvolio','Glenloth','Tarcoola','Pat
ron','Auraria','Newhaven','Gaulus','The Grafter','Merriwee','Clean 
Sweep','Revenue','The Victory','Lord Cardigan','Acrasia','Blue 
Spec','Poseidon','Apologue','Lord Nolan','Prince Foote','Comedy King','The 
Parisian','Piastre','Posinatus','Kingsburgh','Patrobas','Sasanof','Westcourt','Night 
Watch','Artilleryman','Poitrel','Sister Olive','King 
Ingoda','Bitalli','Backwood','Windbag','Spearfelt','Trivalve','Statesman','Nightmarch','Pha
r Lap','White Nose','Peter Pan','Hall Mark','Peter Pan','Marabou','Wotan','The 
Trump','Catalogue','Rivette','Old Rowley','Skipton','Colonus','Dark 
Felt','Sirius','Rainbird','Russia','Hiraji','Rimfire','Foxzami','Comic 
Court','Delta','Dalray','Wodalla','Rising Fast','Toparoa','Evening Peal','Straight 
Draw','Baystone','Macdougal','Hi Jinx','Lord Fury','Even Stevens','Gatum Gatum','Polo 
Prince','Light Fingers','Galilee','Red Handed','Rain Lover','Rain Lover','Baghdad 
Note','Silver Knight','Piping Lane','Gala Supreme','Think Big','Think Big','Van der 
Hum','Gold and Black','Arwon','Hyperno','Beldale Ball','Just A Dash','Gurner's 
Lane','Kiwi','Black Knight','What A Nuisance','At Talaq','Kensei','Empire 
Rose','Tawrrific','Kingston Rule','Lets Elope','Subzero','Vintage 
Crop','Jeune','Doriemus','Saintly','Might and Power','Jezabeel','Rogan 
Josh','Brew','Ethereal','Media Puzzle','Makybe Diva','Makybe Diva','Makybe 
Diva','Delta Blues','Efficient','Viewed','Shocking','Americain');

It is throwing an error. I have tried it in multiple browsers. Firefox Web Developer error console for example says Missing ")" after argument list.

Google Chrome says Uncaught Syntax Error - Unexpected identifier and interestingly has a formatting change after Russia (cold war conspiracy theory anyone?) in the list.

1
  • Ever heard of syntax highlighting? ;) Commented Nov 15, 2011 at 12:30

2 Answers 2

5

You need to change the entry

'Gurner's Lane'

to

'Gurner\'s Lane'

or

"Gurner's Lane"

An IDE with syntax colouring would make the broken quotation obvious (in fact just like SO highlighting).

Sign up to request clarification or add additional context in comments.

Comments

0

You should declare like following to avoid the appostrophy error like "x's".

var arlene2 = new Array("First element", "Second", "Last");

refer to Declare an array in Javascript

1 Comment

I built the list in PHP MYSQL but thanks you are right I am going to need a strategy to deal with this situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.