line break

yangmingjie65

New Member
Messages
1
Reaction score
0
Points
0
Hi,

I wan to run javascript containing following code:

var test1="21.0507865" + "\t"+ "21.0400039"+ "\t" + "21.06445655" + "\n" +
"21.0107865" + "\t"+ "21.0200039"+ "\t" + "21.03445655" + "\n" +
"21.0707865" + "\t"+ "21.0800039"+ "\t" + "21.09445655" + "\n" +
"21.0607865" + "\t"+ "21.0600039"+ "\t" + "21.06445655"

So my data can display in a textarea like following

21.0507865 21.0400039 21.06445655
21.0107865 21.0200039 21.03445655
21.0707865 21.0800039 21.09445655
21.0607865 21.0600039 21.06445655

But when I paste my code in the RVSiteBuilder HTML edit window, “\” in my code was always deleted automatically, so my data can not be displayed normally. What should I do to avoid these kind things?

Thanks for your attention.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. have you tried a double slash \\ ?

2. maybe try embedding a real return, ie

Code:
var cr = "
";

3. "Paste into"??? have you tried typing it in directly?
 
Last edited:

rajat.vaghani37

New Member
Messages
49
Reaction score
0
Points
0
As far as i know /t and /n work only when printing/displaying the output. u cant add that in the variable, wont work like that.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Textareas are one of the few places where those characters will work as expected. It's perfectly valid to have them in a JavaScript string variable/object, but because all contiguous whitespace is treated as a single space character throughout most of HTML, you usually don't run across the tab and newline characters in production code. They are useful, though, in textarea and pre elements (and the now-deprecated pre equivalents, like code, tt, and so on) as well as in JavaScript alert boxes (alert, confirm, input).

As for the SiteBuilder question -- I never touch those things, so I don't know. HTML is a WYSIWYM (what you see is what you mean) markup language; WYSIWYG (what you see is what you get) leaves meaning out of the equation, and leads to inaccessible sites by default. And as far as I'm concerned, if Jaws can't make sense of it, and you can't "view" the site properly on a Braille terminal, that's a failure.
 
Top