0

I'm using a few lines of JavaScript inside an https webpage that I'm uploading. I call the jQuery library as well as the ajax one in the <head> using this code:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"> </script>


<script src="https://code.jquery.com/jquery-1.12.3.js"></script>

After using debugging mode in chrome, I received this mixed content error:


"Mixed Content: the page xyz was loaded over HTTPS, but requested an insecure script 'http://code.jquery.com/jquery-latest.min.js'. This request has been blocked; the content must be served over HTTPS."

I looked around google and stackoverflow (where I often find nice solutions) to find a solution to my problem but was unsuccessful. I need to load these libraries to make my script run (as well as my asynchronous ajax call) but the problem seems to reside in the lib(always checking the debugging console).

More specifically, the following line: jquery-1.12.3.js:10444 which corresponds to

// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
// Use native DOM manipulation to avoid our domManip AJAX trickery
head.insertBefore( script, head.firstChild );

Has anyone ever encountered something similar? How did you resolve this issue?

Raidri
  • 17,258
  • 9
  • 62
  • 65
  • Just did a quick test and it didn't make a request for me at least. On the Networking tab in Chrome Dev tools, there is an "initiator" column which shows which JS file made the actual request. Can you check that for jquery-latest.min.js and confirm if it is indeed from jquery-1.12.3.js? – Rhumborl May 20 '16 at 10:22
  • remove the `https:` parts from your `src` see if it helps – RST May 20 '16 at 10:25
  • RST, I removed the https parts leaving only // but it doesn't work, I found this tips in another thread and I already tried but the error seems not to change. – Daniele Laura Sella May 20 '16 at 10:33
  • Thanks for the prompt reply! I checked on the networking tab as you suggest and the initiator is jquery-1.12.3.js:10444 and also jQuery.ajaxTransport.s.send @ jquery-1.12.3.js:10444 jQuery.extend.ajax @ jquery-1.12.3.js:9750 jQuery._evalUrl @ jquery-1.12.3.js:9914 domManip @ jquery-1.12.3.js:6086 and other more... – Daniele Laura Sella May 20 '16 at 10:38
  • I found the solution, sorry for the inconvenience but the problem was really stupid. I was calling the 'http://code.jquery.com/jquery-latest.min.js' in another page loaded in the div of the main page and that was the one that created so much trouble. Thanks for the availability – Daniele Laura Sella May 20 '16 at 18:59

0 Answers0