inline javascript cannot have the string "</script>"

来源:互联网 发布:刚开淘宝店卖吃的 编辑:程序博客网 时间:2024/04/29 20:45

---<<professional javascript for web developer>>2nd edition  Nicholas C.Zakas@14

when using inline javascript code, keep in mind that you cannot have the string "</script>" anywhere in your code.

在<script></script>中间出现的“</script>”字符串会被解释成结束标签,从而导致错误。解决办法是把“</script>”拆分为多个字符串,例如“</scr” + “ipt>”。

原创粉丝点击