Chikwado Posted March 27, 2015 Share Posted March 27, 2015 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. Link to comment Share on other sites More sharing options...
Ingolme Posted March 27, 2015 Share Posted March 27, 2015 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. Link to comment Share on other sites More sharing options...
davej Posted March 27, 2015 Share Posted March 27, 2015 Are you talking about breaking long strings across lines? var mystr = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbb" +"ccccccccccccccc ddddddddddddddddddddd eeeeeeeeeeeeeee" +"ffffffffffffff ggggggggggggggg hhhhhhhhhhhhhhh iiiiiiii" +"jjjjjjjjjjjjjjjjj"; Link to comment Share on other sites More sharing options...
Chikwado Posted March 27, 2015 Author Share Posted March 27, 2015 (edited) 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. Somethingslike this seem to work: var myText ="some text" + "some more text"; Edited March 28, 2015 by Chikwado Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now