我有一个在HTTPS协议上运行的应用程序。我写了一个Angular函数来使用$ http服务获取数据。
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
服务中的http://gainsight.0x10.info/api/image?page_no=0更改为https://gainsight.0x10.info/api/image?page_no=0,但遗憾的是该服务不可用。
任何帮助..非常感谢
答案 0 :(得分:0)
答案 1 :(得分:-1)
即使你能够调用http端点,你也无法加载资源,因为它位于不同的域上并且你有跨域问题(除非你用jsonp或cors修复它)