0

i am getting script error ("SyntaxError: unterminated string literal") while showing that alert message

<!DOCTYPE html>
<html>
<body>

<script>
var test= "<script>dsfdsf</script>";
alert(test);
</script>
</body>
</html>

can we show script in alert ??

karthi
  • 11
  • 6
  • This is the solution:` ` –  May 15 '14 at 05:54
  • Or move your script to an external .js file and not have to worry about having your JavaScript conflict with your HTML. – JLRishe May 15 '14 at 06:28
  • thats working fine @nakkini wat does that mean ?? <\/script> – karthi May 15 '14 at 06:41
  • @karthi: it means you must escape the slash "/s" symbol, otherwise it won't worK. Please, if my answer works for you (I tested it), accept it. –  May 15 '14 at 06:43
  • u did not post it as answer. so i am unable to accept . – karthi May 15 '14 at 08:10

0 Answers0