Click to See Complete Forum and Search --> : problem with buildin a string with js


pelegk1
10-16-2003, 03:55 AM
i tried to do this :
tmpStr='<HTML><BODY><font face="Arial" size="6"><a href="JavaScript:Submit('+cityList[count]+')">';

and when i press a button i have a proble with the :
cityList[count]
which is a word that i didnt put in quotation
how to put it execlly so i dont get an error?

Gollum
10-16-2003, 04:43 AM
The ol' nested quotes problem...
try this...

tmpStr='<HTML><BODY><font face="Arial" size="6"><a href="java script:Submit(\\''+cityList[count]+'\\')">';