The template string encounters the script and cannot be recognized


We can see in the above figure that the template string will report an error after adding the script tag

Reason: When running JS from top to bottom, first identify the script tag in the template string, it will think that the tag is over, so an error will be reported later ( in fact, it is the same reason that the script tag cannot be placed in the string )

Workaround: Use the escape character "\"




Advertise: Taobao Tmall internal discount group, add me to WeChat to pull you into the group 18801014156


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325622096&siteId=291194637