且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

未终止的字符串文字

更新时间:2023-02-17 14:39:05

你不能在javascript中的字符串之间拆分字符串。你可以通过使每一行成为一个单独的字符串并用加号连接它们来实现相同的可读性,如下所示:

You can't split a string across lines like that in javascript. You could accomplish the same readability by making each line a separate string and concatenating them with the plus sign like so:

var str = "<strong>English Comprehension</strong>"
    + "<br />"
    + "<ul>"
    + "<li>Synonyms/Antonyms/Word Meaning (Vocabulary)</li>"

依此类推......

and so on...