这篇文章上次修改于 2138 天前,可能其部分内容已经发生变化,如有疑问可询问作者。 >火狐浏览器有html的validator,右键---查看源码,红色的script 报错: Stray start tag script . [1] 这个是火狐认为放在body和head外的标签是无效的,放进body或者head里面就好了 ```html ``` [2] 放到body还是head基于两个原则: Scripts in head ``` bash Scripts to be executed when they are called, or when an event is triggered, are placed in functions. Put your functions in the head section, this way they are all in one place, and they do not interfere with page content. ``` Scripts in body ``` bash If you don't want your script to be placed inside a function, or if your script should write page content, it should be placed in the body section. ```
没有评论