JQuery Mobile 和 AJAX Post 的问题
我对这个感到困惑,出于某种原因,仅在黑莓上,我没有在帖子中触及内部“功能”。我正在使用最新的 JQuery Mobile。有人有想法吗?:
function test(data1)
{
alert("I do get here!");
$.post("test.php",
{ data: data1 },
function(xml) {
alert("never here!");
}
);
}
I'm stumped with this one, for some reason only on Blackberry, I'm not hitting the inner "function" on post. I'm using the latest JQuery Mobile. Anyone have an idea?:
function test(data1)
{
alert("I do get here!");
$.post("test.php",
{ data: data1 },
function(xml) {
alert("never here!");
}
);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也遇到过这个问题,但仅限于 5.x 操作系统。
6.0 运行良好。无论出于什么原因,在我的例子中,从 IIS 返回的数据导致该帖子看起来没有成功——尽管它显然成功了。
I had this issue too, but only with 5.x OS.
6.0 works fine. For whatever reason the data returned from IIS in my case is causing the post to look like it didn't succeed -- even though it clearly does.
这只会发生在
onSuccess
上。添加一个error
处理程序以查看出了什么问题。http://api.jquery.com/jQuery.ajax/
http://api.jquery.com/ajaxError/
That will only happen
onSuccess
. Add anerror
handler to see what is going wrong.http://api.jquery.com/jQuery.ajax/
http://api.jquery.com/ajaxError/
最可能的原因是调用没有成功,并且为
指定了回调post()
辅助方法仅在成功时才会被调用。尝试将调用展开为直接的ajax()
调用或设置ajaxError()
或ajaxComplete()
回调以查看是否存在实际问题。The most likely cause is that the call isn't resulting in a success and the callback specified for the
post()
helper method only gets invoked in case of success. Try either unwrapping the call into a straightajax()
call or setting theajaxError()
orajaxComplete()
callbacks to see if there is an actual issue.最终的解决方案是将方法更改为 GET。我不知道为什么,但黑莓浏览器似乎不支持 JQuery POST。
The solution ended up being to change the method to a GET. I'm not sure why but Blackberry browser doesn't seem to support JQuery POST.