Skip to content
Advertisement

Why JavaScript is not working in HTTPS on my site

I have just added HTTPS to my site and apparently the only script I have on my site has stopped working. I don’t think it is a problem of the script, but here it is:

JavaScript

What is the solution to this problem?

Advertisement

Answer

Add your jQuery file like this, without mentioning the protocol explicitly:

JavaScript

Removing the http: part from src means you don’t want to load external files/resources with a fixed protocol that you are mentioning in the src. Rather, you want to load the external resources with the same protocol the demanding resource is residing in.

Advertisement