I need to write a long message in an alert box and want to put a carriage return at the end of each sentence. I know this is done using something like \n . Can anyone tell me exactly what it is and where I can get a list of characters for non-breaking spaces etc. I've tried ascii codes and iso-latin but these don't seem to work. Thanks for any help.
Yes, a carriage return is \n. Look at the code below.
Also, if you want non-breaking spaces in you alert, just add the spaces to you your code.
alert("This is a test!");
Thanks for your reply. I am also trying to write to a table cell using innerText.
So my code says something like:
rows(i).cells(4).innerText = MyVariable + "??"
Where I put the two question marks I want to put two spaces - to indent the text away from the edge of the cell. Just putting two spaces here does not work. Any idea what will?
var row = event.srcElement.parentElement.parentElement;
var table = row.parentElement.parentElement;
var rows = table.rows.length;
//Update current row
var total = row.cells(2).firstChild.value * row.cells(3).firstChild.value
row.cells(4).innerText = "£" + total.toFixed(2) + "??";
The above function does some Maths and writes the answer to a cell. After the total is written I want to write two spaces - to indent the text from the side of the cell. In the code above I have put two question marks where I want the two spaces to appear. If I leave the question marks in they appear on screen. If I remove them and replace them with two spaces (" ") they don't appear on screen and the total is hitting the edge of the cell (which looks ugly.)
They follow the conventions of C++.
Can anyone tell me exactly what it is and where I can get a list of characters
\b = backspace
\f = form feed
\n = new line
\r = carriage return
\t = horizontal tab
\v = vertical tab
\nnn = whatever character nnn is, base8 (\101 = A)
Last edited by gil davis; 01-10-2003 at 09:17 AM.
Thanks for your replies. In the last reply it was stated the convention follows C++ with a slash followed by the base8 character reference. Any idea where I can find a list of base8 character codes.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
It is also called "octal". It's still the Unicode character set, but the decimal number needs to be converted to octal or base 8.
Originally posted by Webskater
Any idea where I can find a list of base8 character codes.
Try replacing your ?? with \u0020\u0020 or \u0009 (Horizontal Tab - equivalent to three spaces.)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)