I have not been able to find a correct answer for this one. I have a script, let's call it http://www.example.com/testing.js
which I used over several sites that are HTTP served. Now I have two new site that are HTTPS served and when I add the file <script src="http://www.example.com/testing.js"></script>
I get the following error
Mixed Content: The page at 'https://location.mysite.com/my-account' was loaded over HTTPS, but requested an insecure script 'http://www.example.com/testing.js'.
This request has been blocked; the content must be served over HTTPS.
I want to use the same file over HTTPS
and HTTP
, what do I need to change or add to my javascript to serve both of them?