PDA

View Full Version : How to insert a new line "\n" in my expression


slaguila
06-27-2006, 01:07 PM
Hello,
How to insert a new line "\n" in my expression?
I have something like:
alertString = alertString + “\n” + " row successfully " ;

Then:
<script type="text/javascript">
alert ("<%=alertString%>");
</script>

But I am getting an error in the "\n".

I want something like:
"alerst string 1"
"alert string 2"

Thanks,
Sandra

RysChwith
06-27-2006, 02:21 PM
What kind of error are you getting? If it's just printing an N instead of the newline, you may need to double escape it (\\n). If you're getting an actual error message, it depends on what the message is.

Rys

slaguila
06-27-2006, 03:11 PM
I didn't know: \\n
Thanks!!!

Sandra