If Chrome DevTools is reporting a 404 for a .map file (maybe jquery-1.10.2.min.map
, jquery.min.map
or jquery-2.0.3.min.map
, but can happen with anything) first thing to know is this is only requested when using the DevTools.
(如果Chrome DevTools报告.map文件的404错误(可能是jquery-1.10.2.min.map
, jquery.min.map
或jquery-2.0.3.min.map
,但可能发生任何事情),首先要了解的是仅在使用DevTools时才要求这样做。)
Your users will not be hitting this 404.(您的用户不会点击此404。)
Now you can fix this or disable the sourcemap functionality.
(现在,您可以解决此问题或禁用源地图功能。)
Fix: get the files(修复:获取文件)
Next, it's an easy fix.
(接下来,这很容易解决。)
Head to http://jquery.com/download/ and click the Download the map file link for your version, and you'll want the uncompressed file downloaded as well.(转到http://jquery.com/download/ ,然后单击您所用版本的“ 下载地图文件”链接,您还需要下载未压缩的文件。)
Having the map file in place allows you do debug your minified jQuery via the original sources, which will save a lot of time and frustration if you don't like dealing with variable names like a
and c
.
(将地图文件放置在适当的位置允许您通过原始资源调试缩小的jQuery,如果您不喜欢处理变量名(如a
和c
,则可以节省大量时间和沮丧的时间。)
More about sourcemaps here: An Introduction to JavaScript Source Maps
(有关源映射的更多信息,请参见: JavaScript源映射简介。)
Dodge: disable sourcemaps(道奇:禁用源地图)
Instead of getting the files, you can alternatively disable JavaScript source maps completely for now, in your settings.
(除了获取文件外,您还可以在设置中暂时完全禁用JavaScript源映射。)
This is a fine choice if you never plan on debugging JavaScript on this page.(如果您从未打算在此页面上调试JavaScript,那么这是一个不错的选择。)
Use the cog icon in the bottom right of the DevTools, to open settings, then:(使用DevTools右下方的cog图标打开设置,然后:)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…