我的网站已安装SSL证书,所有传入请求都重新路由到受保护的URL,但是每当我以这种方式发出AJAX请求时,这就是我得到的响应:
“ https://futminnasugawards18.com/findRide/Offa/Kwara/Bida/Niger/2019-03-15%2015%3A28%3A57/0/1360/”上的页面已通过HTTPS加载,但请求了不安全的XMLHttpRequest端点“ http://futminnasugawards18.com/findRide/Offa/Kwara/Bida/Niger/2019-03-15%2015:28:57/0/1360?type=refresh”。此内容也应通过HTTPS提供。
我该如何解决?
var loc = "https://futminnasugawards18.com/findRide/" + $("#start").val() + "/" + $("#state1").val() + "/" + $("#destination").val() + "/" + $("#state2").val() + "/" + $("#date").val() + "/";
var locval = loc.substr(loc.length - 1);
if (locval == "/") {
var location = loc.substr(0, loc.length - 1);
} else {
var location = loc;
}
var price = $("#pricerange").val(),
rating = $("#ratingrange").val(),
targetUrl = location + "/" + rating + "/" + price + "/",
targetTitle = "";
//$("#menu-nav a[href='" + window.location.pathname + "']").fadeTo(500, 1.0);
window.history.pushState({
url: "" + targetUrl + ""
}, targetTitle, targetUrl);
$.get(targetUrl, {
type: "refresh"
}, function(data) {
$("#placeSearchResults").html(data);
$(".rideResHide").LoadingOverlay('hide');
});