What is jquery.map in the new jquery version (answer)

Source: Internet
Author: User

The source map file is a JS file after compression, the variable name of the file to replace the corresponding, variable location, such as meta-information data files, generally such files and min.js master files in the same directory. For example, after compressing the original variable is a map, after compression by the variable substitution rule may be replaced by a, then the source map file will record this mapping information, the advantage is that, in debugging, if there are some JS error, Then the browser will parse this map file to re-merge the compressed JS, so that developers can use uncompressed code before debugging, which will bring us a lot of convenience! And this kind of reductive debugging function, at present only chorme to have, so will appear the question that the title says, When I introduced Jquery-1.10.2.min.js, under the Firefox or other browser is good, under the Chorme error can not find Jquery-1.10.2.min.map file, 404, because the above mentioned situation, jquery will detect whether the browser supports sour Ce map function, if supported, then go to download the source map file, and this time if you are referring to the official website of the min.js that no problem, it will go to their own directory to find the source map file, If the Jquery.min.js file is on your server and there is no source map on the server, then there will be an error, so there are three ways to solve the problem:

One, citing official website documents

Second, download the source map file and put it on the server (recommended)

Third, the tool of the Chorme file--developer tools--set-->enable source maps hook off, remove this tick, jquery will not download the source map file!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.