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).
If you want to turn off the error message, you can also uncheck enable source maps in Chrome's developer tools setting.
Why does the code that is commented out of this line work? Then you need to know what the source Map is.
What is source Map
The Source map is a JSON-formatted information file that stores the location information. In other words, it is a dictionary file that is compressed after JS. With it, when it goes wrong, the debugging tool will display the original code directly, not the compressed code. This undoubtedly brings great convenience to the developers.
Because it is a Google custom rule, only browsers based on chromium development support this feature for the time being.
Source Map Generation Tool
Closure compiler
Reference links
- Introduction to JavaScript Source Maps
- jquery Official Interpretation
- JavaScript Source Map Detailed
Transfer from http://www.vipaq.com/Article/View/blog/357.html
Fullcalendar Jquery-1.9+.min.map 404 (Not Found) error, Understanding source Map