我正在通過https提供一個頁面,說:「example.com/page.php」跨源請求 - 我錯過什麼
在該頁面是一個jQuery AJAX調用:
$.ajax({
url : "http://example.com/print/printReceipt.php",
dataType:"jsonp",
success:function(data)
{
alert("Success!");
}
});
「打印」 目錄中有一個.htaccess文件,其中包括:
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE"
Header always set Access-Control-Allow-Origin *
jQuery的總是返回一個錯誤:
Mixed Content: The page at '...' was loaded over HTTPS, but requested an insecure script '...?callback=jQuery300107312130929496792_1478818377085&_=1478818377088'. This request has been blocked; the content must be served over HTTPS.
我錯過了什麼?
閱讀錯誤!你的服務是https,你不能使用http請求。 – Nosyara