title: Jquery load https url
body: <p>I have this problem. In external web site I have a script like this:</p>
  
  <pre><code>&lt;div id="idtest"&gt;&lt;/div&gt;
  &lt;script src="//example.com/widget.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>example.com is in https (allow both http and https). In the server in the script widget.js I have:</p>
  
  <pre><code> $('#idtest').load("https://example.com/index.html")
  </code></pre>
  
  <p>I get this error: Mixed Content: The page at 'thepage' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '<a href="http://example.com/index.html">http://example.com/index.html</a>'. This request has been blocked; the content must be served over HTTPS.</p>
  
  <p>I don't understand: why the error and why the endpoint is in "http"? 
  thanks</p>
  
  <p>EDIT</p>
  
  <p>More information: </p>
  
  <p>if in the widget.js I do this:</p>
  
  <pre><code> $('#idtest').load("./index.html")
  </code></pre>
  
  <p>the content is load and all works perfectly if I load the script in my site. </p>
  
  <p>If I do something like:</p>
  
  <pre><code> x = "https://example.com"
   $('#idtest').load(x + "/index.html")
  </code></pre>
  
  <p>or </p>
  
  <pre><code> $('#idtest').load("https://example.com/index.html")
  </code></pre>
  
  <p>I get the error (if I put the script in my site or in external site). Why?</p>
  
  <p>EDIT 2</p>
  
  <p>more informations:</p>
  
  <p>my site is in django </p>
  
  <p>EDIT 3</p>
  
  <p>In firefox I load the page in https and http. It doesn't work in Chrome. I see this situation in firefox net analyzer when call the url :</p>
  
  <p>302 <a href="https://example.com/index.html">https://example.com/index.html</a>
  200 <a href="http://example.com/index.html">http://example.com/index.html</a> [mixed content]</p>
  
  <p>What understand this situation (https to http)? Could be a Django redirect problem?</p>