[Web-SIG] JavaScript escape function

Shannon -jj Behrens jjinux at gmail.com
Tue Apr 26 03:11:46 CEST 2005


Hey guys,

I need a JavaScript escape function.  Let's say I have a variable, and
I'm generating some JavaScript from Cheetah:

    var s = "$s";

I need to make $s safe:

    var s = "$javascript_safe($s)";

Has anyone coded this yet?  Will the same function work for both
single and double quoted strings?  Can I steal some code?

Thanks :-D
-jj

-- 
I have decided to switch to Gmail, but messages to my Yahoo account will
still get through.


More information about the Web-SIG mailing list