Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 混合内容问题$http.get AngularJS_Javascript_Ajax_Angularjs_Http_Mixed Content - Fatal编程技术网

Javascript 混合内容问题$http.get AngularJS

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

我有一个应用程序在HTTPS协议上运行。我编写了一个角度函数来使用$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服务中更改to,但很遗憾,该服务不可用

任何帮助。。非常感谢

删除协议

而不是使用https://... 只需使用//

希望它能起作用:

删除协议

而不是使用https://... 只需使用//

希望它能起作用:


即使您能够调用http端点,您也将无法加载ressource,因为它位于不同的域中,并且存在跨域问题,除非您使用jsonp或cors解决此问题


即使您能够调用http端点,您也将无法加载ressource,因为它位于不同的域中,并且存在跨域问题,除非您使用jsonp或cors解决此问题


它只是在你的url或http前面加上https,关于你当前的协议。它只是在你的url或http前面加上https,关于你当前的协议