如何从Windows Phone 8 html5应用程序调用ajax Web服务?

时间:2014-01-15 12:52:36

标签: ajax jquery-mobile cordova windows-phone-8 windows-phone-8-emulator

我有一个使用jquery mobile和phonegap构建的windows phone 8应用程序示例,当我在浏览器上运行该应用程序时,它没有问题。 问题是,当我从模拟器或设备运行应用程序时,它无法进行ajax webservice调用,我可以知道他们应该启用从模拟器或设备访问webservice调用的任何设置

示例代码:

$.ajax({

        type: "POST",
        url: URL + "Sample.aspx",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        isLocal: true,
        success: function (all) {
            alert("hi2");
            store.set('sampleData', data);    
        },
        failure: function () {
            alert("failure");
        }
    });

0 个答案:

没有答案