Javascript 混合内容问题$http.get AngularJS
我有一个应用程序在HTTPS协议上运行。我编写了一个角度函数来使用$http服务获取数据Javascript 混合内容问题$http.get AngularJS,javascript,ajax,angularjs,http,mixed-content,Javascript,Ajax,Angularjs,Http,Mixed Content,我有一个应用程序在HTTPS协议上运行。我编写了一个角度函数来使用$http服务获取数据 factory.loadImages = function(callback){ $http.get("http://gainsight.0x10.info/api/image?page_no=0") .success(function(data){ callback(data); }).error(fu
factory.loadImages = function(callback){
$http.get("http://gainsight.0x10.info/api/image?page_no=0")
.success(function(data){
callback(data);
}).error(function(status,error){
console.log(status);
});
};
我发现以下混合内容错误:
Mixed Content: The page at 'https://www.hackerearth.com/gainsight-ui-development-hiring-challenge-1/problems/30146b3bf6954bba9752bd5599b3c8aa/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://gainsight.0x10.info/api/image?page_no=0'. This content should also be served over HTTPS.
现在我尝试在$http.get服务中更改to,但很遗憾,该服务不可用
任何帮助。。非常感谢删除协议
而不是使用https://... 只需使用//
希望它能起作用:
删除协议
而不是使用https://... 只需使用//
希望它能起作用:
即使您能够调用http端点,您也将无法加载ressource,因为它位于不同的域中,并且存在跨域问题,除非您使用jsonp或cors解决此问题
即使您能够调用http端点,您也将无法加载ressource,因为它位于不同的域中,并且存在跨域问题,除非您使用jsonp或cors解决此问题
它只是在你的url或http前面加上https,关于你当前的协议。它只是在你的url或http前面加上https,关于你当前的协议