chuckdawit
Jun 8th 2007, 9:28 pm
I can't separate my strings onto new lines using the alert box. I want to separate my phone numbers onto new lines and then print them in the alert box like so:
<A HREF='javascript:(function(){
var s = "";
for (var i = 0; i < phoneArray.length; i++) {
s += phoneArray[i] + "\n";
}
alert(s);
} ) ()'>Phone Numbers</A>
I've tried every combination I can think of (single, dubble quotes, \n, \r, etc) nothing will split them in the result string. And I reload the page every time. Do I need to do something else?
<A HREF='javascript:(function(){
var s = "";
for (var i = 0; i < phoneArray.length; i++) {
s += phoneArray[i] + "\n";
}
alert(s);
} ) ()'>Phone Numbers</A>
I've tried every combination I can think of (single, dubble quotes, \n, \r, etc) nothing will split them in the result string. And I reload the page every time. Do I need to do something else?