I have this code bit:
var description = '${requestScope.description}';
In the above code if
${requestScope.description} = '''''''''
IE is throwing script error. How to solve this problem?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Can you fix it using the technique mentioned in https://stackoverflow.com/a/1473192/476786 as suggested by @xdazz.
If not, try using double quotes as follows:
Edit: OP says that
descriptioncould also potentially contain ” (double quotes):In that case, you could replace the double quotes before you output the string as:
This would replace all instances of double quotes with 2 single quotes.
Please note that my
jspisvery weak, and as such the code sample above might need a tweak or two… 🙂