Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.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 Ionic应用程序在浏览器上工作,但在设备上不工作?_Javascript_Html_Css_Angularjs_Ionic Framework - Fatal编程技术网

Javascript Ionic应用程序在浏览器上工作,但在设备上不工作?

Javascript Ionic应用程序在浏览器上工作,但在设备上不工作?,javascript,html,css,angularjs,ionic-framework,Javascript,Html,Css,Angularjs,Ionic Framework,我已经设计了应用程序使用离子和angularjs。之前该应用程序运行良好,但现在我已更改了api…该应用程序在浏览器上工作,但在设备上不工作…其功能在设备上不工作。。 更改api之前(应用程序在设备上工作): 更改代码中的api后(应用程序在设备上不工作): 如果请求没有失败,请尝试进行调查。据我所知,在设备上的Ionic上有一些远程调试。如何在Ionic中使用https?这可能会有所帮助 var CONSTANTS = "http://ip_address/api/"; var api =

我已经设计了应用程序使用离子和angularjs。之前该应用程序运行良好,但现在我已更改了api…该应用程序在浏览器上工作,但在设备上不工作…其功能在设备上不工作。。 更改api之前(应用程序在设备上工作):

更改代码中的api后(应用程序在设备上不工作):


如果请求没有失败,请尝试进行调查。据我所知,在设备上的Ionic上有一些远程调试。如何在Ionic中使用https?这可能会有所帮助
var CONSTANTS = "http://ip_address/api/";
var api =  CONSTANTS+'api.php?method=register' + '&user_registration=';

$http.post(api, {username : username,email : useremail,pwd : userpassword}).success(function(response) {   

    if( response[0].status == 1){               

        $cordovaToast.showShortBottom('Successfully Registered').then(function(success) {
            // success
        }, function (error) {
            // error
        });  

        document.getElementById('user_email').innerHTML = "";
        document.getElementById('user_email').innerHTML = "";
        document.getElementById('user_email').innerHTML = "";
        $state.go('auth.login');

    }else if( response[0].status == 0){

        $cordovaToast.showLongBottom('Existing User or Invalid Data').then(function(success) {
            // success
        }, function (error) {
            // error
        });  

    }else {
        //console.log('Error');
    }

}, function(err) {
    // console.log(err);
});
var CONSTANTS = "https://www.test.com/api/";
var api =  CONSTANTS+'api.php?method=register' + '&user_registration=';

$http.post(...)... // Same as above