jQuery-1.9+.min.map 404 (Not Found) 错误,了解Source Map
来源:互联网 发布:淘宝网服务中心电话 编辑:程序博客网 时间:2024/04/18 22:20
当打开引入jQuery脚本的页面时,在Chrome的控制台中报了“GET http://localhost/libs/jquery.min.map 404 (Not Found)”的错误。
刚开始以为是Chrome安装插件导致的错误,可是把引入换成jQuery开发版本时,错误就不见了。并且只有Chrome会有这个错误提示,FireFox、IE不会报错。
后来发现原来是jQuery脚本中 "//@ sourceMappingURL=jquery-1.10.2.min.map
" 这一行惹的祸。
如果是布置到生产环境中去,你可以把上面那行代码直接删掉。
如果是在开发环境中,你应该下载jquery-1.10.2.min.map文件,放到jQuery同级目录中去(需要对应的source map文件)。
如果想关掉错误提示,还可以在Chrome的Developer Tools的Setting中将Enable source maps取消选中。
为什么这行被注释掉的代码,会起作用呢?那么就需要了解一下什么是Source Map。
什么是Source Map
Source map就是一个Json格式的信息文件,里面储存着位置信息。也就是说,它是压缩后Js的一个字典文件。有了它,出错的时候,调试工具将直接显示原始代码,而不是压缩后的代码。这无疑给开发者带来了很大方便。
因为是Google自定义的规则,暂时只有基于Chromium开发的浏览器支持这个功能。
Source Map生成工具
Closure编译器
参考链接
- Introduction to JavaScript Source Maps
- jQuery官方释义
- JavaScript Source Map 详解
0 0
- jQuery-1.9+.min.map 404 (Not Found) 错误,了解Source Map
- 解决jquery-1.10.2.min.map 404 Not Found错误
- 导致jquery.min.map 404 (Not Found)错误的原因
- jquery.min.map 404 (Not Found)
- jquery.min.map is triggering a 404 (Not Found)
- jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)
- jquery-1.10.2.min.map 404 (Not Found)问题及解决
- jquery-1.10.2.min.map 404 (Not Found)问题及解决
- jquery.min.map 404 原因
- Chrome调试时提示angular.min.js.map 404 (Not Found)问题的解决
- jquery.min.map 404的解决办法
- Source not found错误
- bootstrap.css.map 404 not found
- xcode : map file not found
- GET http://test01.com/jquery-1.9.1.min.js [HTTP/1.1 404 Not Found 3ms]
- Source map
- eclipse远程debug错误:“source not found”
- 【Android调试】Source Not Found错误
- 【BZOJ 2786】 Ural1142 Relation
- Java String类的split方法使用
- ER-Studio的五种关系说明
- POJ 2236 Wireless Network (并查集)
- PyPy 和 CPython 的性能比较测试
- jQuery-1.9+.min.map 404 (Not Found) 错误,了解Source Map
- 第一次c++
- net.ipv4.tcp_tw_recycle参数造成的连接不稳定
- java.lang.IllegalArgumentException: Wrong state classs
- Smartform循环打印
- 【Android】 完美解决ScrollView嵌套ListView滑动冲突(有图有真相)
- POJ 1703 Find them, Catch them (并查集)
- mysql主从同步配置
- HttpClient使用详解