Re: Embedding JavaScript Within JavaScript

by Nathan Lyle <natlyle(at)nmu.edu>

 Date:  Wed, 01 Nov 2000 04:01:34 -0500
 To:  Ben Ocean <lists(at)TheWebsons.com>
 Cc:  hwg-techniques(at)hwg.org
 In-Reply-To:  thewebsons
  todo: View Thread, Original

><Ben>
>Clearly, the problem is in the nested single quotes. But how do I nest
>double quotes within single quotes while dynamically generating the page
>when JavaScript parses double quotes???

It's late (well, early) so if I missed something in your example code and
get this answer wrong, my apologies. <grin>

I'm wondering if just using the escape character thingie would work?

         document.writeln("document.writeln(\"alert(\"hi there.\");\");");

I ran into the same problem that you described, a while ago, but I can't
remember what it was that I used to get around it. I may have just changed
the way I was trying to do the job. But, the little back slash thing comes
in handy.  :)

I hope that helps....

~Nathan Lyle

http://euclid.nmu.edu/~natlyle
natlyle(at)nmu.edu or jopling(at)geocities.com
(906)227-5736

"There's a sucker born every minute." - P. T. Barnum - Circus promoter

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA