Back to previous

Adding Line break in Javascript string (Unterminated string)

Somehow Javascript complaint about Unterminated string constant when I tried to add a line break (\n) into a string variable. If viewed in source, it looks alright. After all, do something like that fix that problem:

string strMessage = "return confirm('Are you sure you want to delete this employee profile?\\n";

ShareThis

If you think this post is useful, please recommend me at the bottom of the page. ;)

Discussion