0
    $http.post(myurl, myreq).success(function(apiReply) {
        if (! checkApiResponse(apiReply)){
            console.log("failed to run action with error: " + apiReply.retcode + " " + apiReply.retbody)
            return false
        } else {
            callback(apiReply)
        }
    }).error(function(data, status) {
        var errmsg = "handle api request failed with status: "
        errmsg += status + ", error response: " + data
        console.log(errmsg)
        ons.notification.alert({
            //title: "错误",
            //message: '连接服务器失败',
            title: "提示",
            message: "请检查您的网络环境",
            buttonLabel: ['确认']
        });
    });
}

here is my way to post data ,when using http url,it works fine,but doesn't work when i use https url, what should i do?

  • 1
    _"You cannot make an AJAX request to an https page if you are currently in http because of the Same Origin Policy."_ http://stackoverflow.com/a/15375957/1913729 – blex Apr 23 '16 at 14:32
  • thx,i solved my issue by use https protocol in url.anyway ,thank u – AlexLiu May 05 '16 at 02:53

0 Answers0