cabrera48
asked on
Unable to escape quotes on javascript
Why is the following code giving me an error message?
<a href="#" onclick="javascript:alert( 'This is a \"quotes\" test');">Test quotes</a>
Isn't it the escape characters take care of not taking the quotes " as the end of the string?
This is the error message I am getting:
unterminated string literal
[Break on this error] alert('This is a \
<a href="#" onclick="javascript:alert(
Isn't it the escape characters take care of not taking the quotes " as the end of the string?
This is the error message I am getting:
unterminated string literal
[Break on this error] alert('This is a \
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
String.fromCharCode(34) works, thanks !!!
<a href="#" onclick="javascript:alert(