I have this problem. On an external website, I have a script like this:
<div id="idtest"></div> <script src="//example.com/widget.js" type="text/javascript"></script>
example.com is located at https (allow both http and https). On the server in the widget.js script, I have:
$('#idtest').load("https://example.com/index.html")
I get this error: Mixed content: the page on the 'thepage' page was loaded via HTTPS but requested the XMLHttpRequest http://example.com/index.html 'insecure endpoint. This request is blocked; content must be transmitted via HTTPS.
I do not understand: why is the error and why is the endpoint in "http"? thanks
EDIT
Additional Information:
if in widget.js i do this:
$('#idtest').load("./index.html")
the content is loading and everything works fine if I upload a script to my website.
If I do something like:
x = "https://example.com" $('#idtest').load(x + "/index.html")
or
$('#idtest').load("https://example.com/index.html")
I get an error (if I put the script on my site or on an external site). Why?
EDIT 2
Additional Information:
my site is in django
EDIT 3
In firefox I load the page in https and http. It does not work in Chrome. I see this situation in the firefox network analyzer when url is called:
302 https://example.com/index.html 200 http://example.com/index.html [mixed content]
What do they understand this situation (https to http)? Could there be a Django redirect problem?
RoverDar
source share