Escape Character Help: onclick='myFunction(1,"+iParseThisString+")'
Posted on 2006-05-18
If you know about how to use escape character, I think it should be very easy for you to help me.
I need to parse string variable within single quotes like this:
var iParseThisString = "Hello";
document.write ("<table><tr><td onclick='myFunction(1,"+iParseThisString+")'>Link</td></tr></table>");
THE PROBLEM IS: iParseThisString as a string cannot be parsed.
Error is "Hello is not defined"
Character \ must be used, but how?..................