混合内容问题$http.得到AngularJS
Mixed Content Issue $http.get AngularJS
我有一个在HTTPS协议上运行的应用程序。我写了一个Angular函数来使用$http service获取数据。
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://gainsight.0x10.info/api/image?page_no=0到https://gainsight.0x10.info/api/image?page_no=0在我的$http.get
服务,不幸的是不可用。
任何帮助。感谢
删除协议!!
用//...
代替https://...
。
希望它能起作用:)
参考即使您能够调用http端点,您也无法加载资源,因为它位于不同的域中,并且您有跨域问题(除非您使用json或cors修复该问题)
http://www.d-mueller.de/blog/cross-domain-ajax-guide/相关文章:
- spring和angularJS(我得到了类似HTTP状态404的错误)
- HTTP请求使用cURL,但在浏览器中使用javascript时会得到CORS响应
- AngularJS HTTP Get 没有得到响应
- 当我打开之前下载的网页时,一个 http:// 得到变成了一个 file:/// 得到,为什么
- $http得到返回未找到,而直接请求效果很好
- 为什么我在此控制器中得到“未定义$http”
- 为什么HTTP请求中止或我可以'没有得到回应
- 修改一个index.aspx文件,然后得到一个http 404
- 得到http://MY_DOMAIN.com/socket.io?EIO=3&transport=轮询&
- 美元AngularJS http.得到参数
- 如何使javascript等待,直到它得到一个有效的响应,从同步http请求
- 视图有时在$http调用后没有得到更新
- node . js http.Get vs Google chrome $.得到,速度差
- 并行http get请求在node.js应用程序完成后得到连接
- 返回http之前的Angular JS函数.得到完成
- 我一直得到http 403错误为谷歌Oauth 2.0(钛合金)
- 嵌套的http美元.得到的功能
- 混合内容问题$http.得到AngularJS
- 如何包含"="在AngularJs中$http.得到参数
- 美元AngularJS http.得到服务