views:

78

answers:

1
+2  A: 

I don't use the inlined event handlers -- for the same reason I refuse to use the style attribute for css. Jquery just makes it to easy to do class="foo" on the html and $('.foo').click( function () {} ), in an external .js file.

But, for the purpose of doing my best to answer this question, check out these docs on Template::Filter for the ones in core.

It seems as if you could do [% s | replace( "'", "\'" ) %], to escape single quotes. Or you could probably write a more complex sanitizing javascript parser that permits only function calls, and make your own Template::Filter

Evan Carroll
Although I agree with your advice, I've just realized the real solution has another backslash: [% s | replace( "'", "\\'" ) %]
Zach