CF method/function for escaping javascript?

So…*converting a rails app I wrote and need something to escape javascript response from a cfinclude file.

I’ve got most of it manually escaped, but I have a ‘helper’ cfc method that generates html and if I manually escape the double quotes there, it breaks in the regular parts of the page.

Does CF have a way to escape javascript? Did a google search (and forum search) and didn’t come up with anything. Only thing google returned was the javascript escape() function, which does me no good on the CF server.

ANY help is appreciated. Thanks.


This escapes Javascript characters.


thank you!

When did this show up? The way I’m reading the doc page, it’s been since MX…*don’t know how I missed this.

Yeah, she’s a nice BIF, especially when you throw data to and fro from CF and Javascript.