Formatting this JavaScript Line

前端 未结 6 1016
盖世英雄少女心
盖世英雄少女心 2020-12-22 01:02

I am trying to format this line of code in my popup window, but i am facing unterminated string literal error.

Can somebody please tell me how best I co

6条回答
  •  無奈伤痛
    2020-12-22 01:15

    It's because you're using nested double quotes. Quotes delimit strings so when you get to the second one, it thinks the string has ended, as you can see from the colour highlighting in the code you posted. You need to escape them with \":

    window.setTimeout("winId.document.write('\n')", 10);
    

提交回复
热议问题