[thelist] Javascript Woes

jeff jeff at members.evolt.org
Mon Feb 19 21:08:22 CST 2001


asif,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Asif Suria
:
: Probably the single quotes in your
: function could be a problem.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

the javascript parser does not care which type of quote (single or double)
you use to wrap your strings with.  what it does care about is that it
doesn't encounter any unescaped quotes of the same kind as you chose to wrap
that string.  if it does encounter unescaped quotes of the same kind it will
throw an error indicating such.

for matters of readability and reducing the necessity of escaping characters
i have adopted a policy of using single-quotes as my string wrapper in
javascript.  double-quotes are used only around html attribute values or
quoted text.

good luck,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org





More information about the thelist mailing list