Defining a long string with javascript
This question already has an answer here:
只要把在每行的最后仍然在字符串中
str = " The quick brown // <---
fox jumped over the log.";
Easiest thing to do is to add a at the end of the lines:
function test_str() {
str = " The quick brown
fox jumped over the log.";
alert(str);
}
jsFiddle example
尝试这个:
str = " the quick brown foxrn" +
"fox jumped over the lazy dog";
链接地址: http://www.djcxy.com/p/30438.html
下一篇: 用javascript定义一个长字符串