[Zope] <dtml-var xxxx javascript_quote>

Dieter Maurer dieter@handshake.de
Sat, 18 Aug 2001 22:10:16 +0200 (CEST)


Loren Stafford writes:
 > I find myself stuffing arbitrary strings into javascript pop-up displays,
 > but those strings often contain characters (e.g. quotes) that break the
 > genearated javascript syntax. I know there is no javascript_quote argument
 > for dtml-var, and I probably have to filter the string with an external
 > method.
 > 
 > Does anyone have such an external method already in use that you could share
 > with the list?
Quoting rules in Python and Javascript are identical.
This means "repr" has a good chance to do what you want.


Dieter