<dtml-var xxxx javascript_quote>
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? -- Thanks -- Loren
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
participants (2)
-
Dieter Maurer -
Loren Stafford