今天写Web作业,在建立浏览器本地数据库的时候
突然报了这样的一个错误。
index.html:1 Refused to execute script from 'http://localhost:63342/WebWork/HomeWork/Lab15/js/table_present' because its MIME type ('application/octet-stream') is not executable, and strict MIME type checking is enabled.
// index.html:1拒绝执行“http://localhost:63342/webwork/hoeshook/lab15/js/table_present”中的脚本,因为其mime类型(“application/octet stream”)不可执行,并且启用了严格的mime类型检查。
检查之后发现是JS文件的命名不规范。在WS编译器中命名JS文件的时候不能够带下划线的形式命名。
即table_present.js形式命名是不允许的。
本文讲述了在Web开发过程中,由于JS文件命名不规范导致的MIME类型错误。具体表现为使用下划线命名JS文件,如table_present.js,在某些编译器中会引发执行错误。文章强调了正确命名的重要性。

1829

被折叠的 条评论
为什么被折叠?



