why jquery is blocked in https ?

12,153

Solution 1

You need to load the jQuery script from a secured HTTPS protocol. Just use https://code.jquery.com/jquery-3.3.1.min.js and the error should be gone. Cheers.

Solution 2

It's always best to load scripts and/or css from CDN's using <script src="//code.jquery.com/jquery-3.3.1.min.js"></script> without https: or http: as then based on the protocol you are on, the correct CDN protocol will be used. Cause if you hardcode https: you will get the same errors when the page requesting the CDN file is on http:

Share:
12,153

Related videos on Youtube

MydroX
Author by

MydroX

Updated on June 04, 2022

Comments

  • MydroX
    MydroX almost 2 years

    I got a problem when i go on my website with https. The CDN of jquery is blocked. Here is the message send in console Mixed Content: The page at 'https://eoxys-esport.com/?here=home' was loaded over HTTPS, but requested an insecure script 'http://code.jquery.com/jquery-3.3.1.min.js'. This request has been blocked; the content must be served over HTTPS.

    The website works when i am in http.

    • void
      void about 6 years
      load https://code.jquery.com/jquery-3.3.1.min.js
    • Saikat Hajra
      Saikat Hajra about 6 years
      it is expected that when you are using any secure domain using HTTPS any call to other domain will be secure calling like https, not HTTP. you just change you jquery cdn protocol to 'https` it will work