小编sur*_*ers的帖子

无法从其他域访问php文件

我在Eclipse中用JQuery Mobile和PhoneGap编写了一个android移动应用程序.在应用程序中,我调用jquery ajax来加载来自其他域的数据列表.

我的jquery ajax调用代码是:

$.ajax({
            type: "POST",
            url: WEBSERVICE_URL,
            async: false,
            data: dataString,
            dataType: 'json',
            crossDomain: true,
            success: function(data) {
                loginData = new Object(data);
                hideActivityIndigator();
                if(loginData.success == "true"){
                    $.mobile.changePage("#selectionScreen", "slide", false, true);
                } else {
                    $("#message_ajax").html("Invalid UserName/Password.");
                }
            },
            error: function(xhr, ajaxOptions, thrownError){
                alert(xhr.status);
                alert(thrownError);
                hideActivityIndigator();
            }
        });

变量"WEBSERVICE_URL"具有其他域php服务URL.在"pageview"事件上执行上面的代码时,我收到以下错误

Error: NETWORK_ERR: XMLHttpRequest Exception 101

任何解决方案都可以从JQuery Mobile + PhoneGap中的其他域访问服务......?

eclipse jquery android jquery-mobile phonegap-plugins

5
推荐指数
1
解决办法
510
查看次数