Encodes the input string for safe output within JavaScript code. The encoding in meant to mitigate Cross Site Scripting (XSS) attacks. This function can provide more protection from XSS than JSStringFormat does.
encodeForJavaScript(string [, canonicalize])
→ returns string
falsecanonicalize method and then do encoding.
bx-esapi module.
encodeForJavaScript("foo()")
Expected Result: foo\x28\x29
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.