Create a variable in jquery with html content

前端 未结 5 1007
死守一世寂寞
死守一世寂寞 2021-02-09 13:18

Hi I am trying to create a variable in jquery that contains a table for outputting in different areas of a website. But it is giving me an error, and I do not understand why. He

5条回答
  •  无人及你
    2021-02-09 13:50

    You haven't handled the line returns in your string. Because of this, javascript assumes that the end of each line is the end of a statement. Clearly each line is not a valid statement. Concatenate your string like so:

    var "multi-"+
        "line "+
        "string";
    

提交回复
热议问题