I have a JTemplate string that looks like this
<a class="add" href="#" onclick="javascript:myfunction('{$T.Properties.Title}')" >
This code breaks when my parameter $T.Properties.Title is a string which contains a single quote character in it.
I could use a double quote character while passing my parameter value, but my code will then break for double quotes.
How do I escape the input string so that my code works for strings that have both single and double quotes in them?