Jump to content
Chikwado

JavaScript String

Recommended Posts

Some one check this: How to break javascript string text. I have try the following but it stop javascript to output:

/
                                    
n
nr
/n/r
some one check it.

Share this post


Link to post
Share on other sites

What do you mean with "break javascript string text"?

 

Do you mean a line break?

If you're outputting this to HTML, you need to use a <br> element. If this is in the console or an alert() box, then n is enough.

Share this post


Link to post
Share on other sites

Are you talking about breaking long strings across lines?

var mystr = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbb"           +"ccccccccccccccc ddddddddddddddddddddd eeeeeeeeeeeeeee"           +"ffffffffffffff ggggggggggggggg hhhhhhhhhhhhhhh iiiiiiii"           +"jjjjjjjjjjjjjjjjj";

Share this post


Link to post
Share on other sites
Congratulations!  Exactly! Davej.       While writing in my notepad, some times when I look at the left side that I started the "var" it's a long way. Ok, to the right side it's over 100cm. I need to jump to the next line.                                            Somethings
like this seem to work:
var myText ="some text" + "some more text";
Edited by Chikwado

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×