Information about Jquery.min.map 404 (not Found) appears after the Chrome update
What the hell is this thing? Query, got the following information
- Official JQuery explanation
Extract the Content
There will be @ Sourcemappingurl=jquery.min.map in the original code after the JQuery 1.9.0 version
What is source map
Simply put, the Source map is an information file that stores the location information. That is, each position of the converted code, corresponding to the position before the conversion.
With it, when the error occurs, the Debug tool will display the original code directly, not the converted code. This has undoubtedly brought great convenience to the development.
Causes Jquery.min.map 404 reasons
After the update, Chrome opens the option to enable source maps, but you don't have the source map to cause the file to be found.
Solutions
When you open a page that introduces a jquery script, the error "GET Http://localhost/libs/jquery.min.map 404 (Not Found)" is reported in Chrome's console.
At first I thought it was a bug caused by the chrome installation plug-in, but when we switched the introduction to the jquery development version, the error disappeared. And only Chrome will have this error message, FireFox, IE will not error.
It turned out to be a curse in the jquery script " //@ sourceMappingURL=jquery-1.10.2.min.map
".
If it is arranged in a production environment, you can delete the above line of code directly.
If you are in a development environment, you should download the Jquery-1.10.2.min.map file and put it in the jquery sibling directory (you need the corresponding source map file).
Solution Mode 1.
Set Developer Tools, Enable source maps to close
Solution Mode 2.
Download the same version of source maps with Jquery.js directory
Source maps will be in the same position as jquery
Jquery location Http://code.jquery.com/jquery-1.10.2.min.js
Source Maps Location Http://code.jquery.com/jquery-1.10.2.min.map
Jquery.min.map 404 (Not Found) causes and workarounds for errors