Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

javascript - jQuery的jquery-1.10.2.min.map触发404(未找到)(jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found))

I'm seeing error messages about a file, min.map , being not found:

(我看到未找到有关文件min.map错误消息:)

GET jQuery's jquery-1.10.2.min.map is triggering a 404 (Not Found)

(GET jQuery的jquery-1.10.2.min.map触发404(未找到))


Screenshot(屏幕截图)

在此处输入图片说明

Where is this coming from?

(这是哪里来的?)

  ask by Paul Irish translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.mapjquery.min.mapjquery-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,如果您不喜欢处理变量名(如ac ,则可以节省大量时间和沮丧的时间。)

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图标打开设置,然后:)

在此处输入图片说明

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...