Linked Questions

41 votes
9 answers
21k views

It doesn't really have to add newlines, just something readable. Anything better than this? str = "line 1" + "line 2" + "line 3";
18 votes
6 answers
16k views

The question is: What is the JavaScript method to store a multiline string into a variable like you can in PHP?
luca's user avatar
  • 37.2k
11 votes
3 answers
8k views

Possible Duplicate: Multiline strings in Javascript In Ruby you can do something like this: temp = <<-SQLCODE select * from users SQLCODE This way you have very long string literals in your ...
0 votes
4 answers
18k views

I have got a string from an ajax call. That variable directly comes from a text field from the MySQL database. But after getting that value I'm unable to console log it. By Console debug it is saying ...
7 votes
1 answer
11k views

In Python, there are these triple quotation marks ('''), for multiple line strings, which is very useful. Is there any way to do this in javascript?
9 votes
7 answers
299 views

I have a simple problem that I just can't seem to figure out. In the code below I get an error (test_str is not defined) because the line defining "var str=" is spread across two lines. After the ...
Thread7's user avatar
  • 1,090
1 vote
4 answers
7k views

I declare a string of HTML and set it equal to a variable. I can't think of any reason it would generate an error, yet here it is: Uncaught SyntaxError: Unexpected identifier on Ln 136. Ln 136: ...
Don P's user avatar
  • 64.3k
3 votes
5 answers
9k views

I try to send HTML but I get an error when writing the value at the content key as multiline string. What is the valid syntax for this? var data = { "subject":"Test", ...
5 votes
2 answers
6k views

I am using JQuery to dynamically add a new row to a table. I would like to have a placeholder inside the table cells that go away when the user clicks to enter text. I attempted to make CSS that would ...
marc's user avatar
  • 835
2 votes
1 answer
7k views

Python has triple quoted string which provides free text input. There is no need next line character to define next line. Here is an example; hello = """ This string is bounded by ...
Ahmet DAL's user avatar
  • 4,742
-2 votes
2 answers
2k views

I am currently building a Slack Bot using Node JS to consume my Rails API. I'd love to give Slack users who use the bot the option to view detailed help when they put in certain keywords. Currently, ...
Cent's user avatar
  • 881
0 votes
2 answers
1k views

says I have a long list of item a b c I want to quickly split them into array, I did "a b c".split('\n') but I got Uncaught SyntaxError: Invalid or unexpected token what's the problem?
akibo's user avatar
  • 725
4 votes
3 answers
384 views

Possible Duplicates: a more graceful multi-line javascript string method Multiline strings in Javascript window.lastSavedContents = "test tester"; That's my JavaScript Code. I get a firebug ...
Shamoon's user avatar
  • 43.9k
0 votes
1 answer
2k views

I am trying to add a line break to a jQuery parameter string. I have tried \n and + \n + and <br />. Any of these break it. Here is a sample of the code. $(function() { $('#products').grid({...
0 votes
1 answer
1k views

Possible Duplicate: How to create multiline strings is it a way to assign following text to a variable more easily: line 1 line 2 line 3 instead of: t="line 1\nline 2\nline 3"; I want copy ...
Real Dreams's user avatar
  • 18.2k

15 30 50 per page
1
2 3 4 5
...
17