why following javascript fail, when click on link? , there way fix it?
<a onclick="alert('do want delete < > " '?');">link</a> i aware escaped characters illegal if printed literally, can't see why should fail when escaped. leaving out characters not option, user defined.
' considered single quote, need escape \, \'
without escaping, javascript throw "unterminated string literal" error.
this works:
<a onclick="alert('do want delete < > " \'?');">link</a>
Comments
Post a Comment