I'm creating a table to display DB records. Someone stored:
<script>alert('hello');</script>
in the database. So when it constructs the table it closes out the script too early.
I did a temp fix by replacing with nothing server side but that would be...a pain in the rear to say the least. How do I make JavaScript treat a string as a string, and ignore closing tags?
data[i] = new Array("INCIDENT NUMBER",
"ARREST",
"<script>alert('hello')</script>",
"DSO",
"USER",
"11-020906",
"10-100",
"02/09/2011",
"",
"",
"",
"",
"");
Using JSP server side.
So I've boiled this down to server side resolution. There is no way to make the browser ignore the tag in a string.