JavaScript embedding [removed] tags in [removed] not working

后端 未结 3 931
盖世英雄少女心
盖世英雄少女心 2021-01-13 04:39

I\'m not sure what is wrong with my code, but when I try and add actorWin.document.write(\'

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 05:09

    If your embedding javascript in an HTML page the HTML parser when it finds your first script tag will immediately try to find the closing tag. Since your closing script tag is in your document.write you'll find yourself in a pickle.

    You can easily just escape the closing forward slash on the tag with a backslash:

    document.write("') 
    

    To:

    document.write("
    
                                     
                  
提交回复
热议问题