【发布时间】:2013-10-03 07:51:10
【问题描述】:
我正在将一个在 android 和 ios 上运行良好的 html5 Phonegap 应用程序转换为 wp8 应用程序,目前我的 ajax 调用不工作..奇怪的远程 ajax 调用工作。这是有效的ajax调用:
function textSearch() {
$.ajax({
type: "POST",
url: baseUrl + "ajax/AppService.aspx/GetByFullSearch",
data: JSON.stringify({"query":$('#search_location').val()}),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (all) {
searchResult = all.d;
showLocationResult();
}
});
};
这是我的本地 ajax 调用不起作用:
$.ajax({url:"./pages/result.html" ,success:function(result){
$("#maincontents").html(result);
}});
这个我试过了,还是不行
$.ajax({
url: "./pages/result.html",
cache: false
})
.done(function( html ) {
alert("hello?");
$( "#maincontents" ).append( html );
});
我从 ajax 收到如下错误:
error:function(jqXHR,textStatus,errorThrown ){
alert(textStatus);
},
textStatus 返回“错误”..... 模拟器使用 ie10,我研究过重置 ie10 设置,更新了模拟器, 试图添加数据类型:'html',缓存:假,没有运气
希望有人知道这让我发疯!
【问题讨论】:
-
这可能与您的问题有关吗? stackoverflow.com/questions/15679045/…