Question

I got web page that adds a jQuery min from a CDN

<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>

The problem is that, when I check the Sources tab in DevTools, I see the jQuery minified, and also the full version. Like this

As you can see, I got the two versions added

I checked in the HTML code, and I'm not adding the non-minified version manually

You can see it here

enter image description here

and for the last, I searched on my project for "Jquery" to see if I could find any missed call, and I couldn't find anything (this picture is too big, because I used jQuery('#foo') instead of $('#foo') but trust me on this one)

So the question is: Why I'm getting added the non-minified version of jQuery library ? Is the jQueryUI loading it ? I tried to load the minified version of jQuery first to see if jQueryUI avoids the try to loading, but the issue still happens.

Thanks in Advance

Was it helpful?

Solution

jQuery 1.10.x had a source map comment (the second line of the minified script), so Developer Tools features (like Google Chrome Developer Tools, perhaps Firebug, perhaps Internet Explorer F12 Developer Tools, perhaps Firefox Developer Tools) load the uncompressed script and let you debug jQuery using it. It will not be loaded by the browser if the Developer Tools feature is not activated by the user.

In other words, do not worry about it, it will not load for the regular user.

You can disable loading it by going to the Google Chrome Developer Tools feature, clicking on the cog wheel button and unticking "Enable JavaScript source maps". Then even when the Developer Tools feature is activated (well, yours, specifically), it will not load the source map or the uncompressed script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top