移动浏览器中的jquery帖子不起作用 [英] jquery post in mobile browser doesn't work

查看:148
本文介绍了移动浏览器中的jquery帖子不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下代码在Web应用程序中使用jQuery进行发布请求:

I'm trying to make a post request with jQuery in a web application with the following code :

alert('1');
$.post(server_hostname, 
       { method: 'getTimestamp', type: 'text', partnerKey: partnerKey },
       function(results, textStatus) {
           alert(results)
           alert('2');
       },
       'text');

在我的计算机上的chrome和Firefox中,效果很好,但在Safari浏览器(适用于iOS和Android浏览器)中却无法正常运行.我猜$ .post()在移动浏览器中没有成功,但是为什么呢? 另一方面,如何查看我的iPhone/Android输出的javascript错误?

That's working very well in chrome and firefox on my computer but not in safari for iOS nor in the Android browser. I guess $.post() doesn't success in a mobile browser but why? On the other hand, how can I see the javascript errors output with my iPhone/Android ?

谢谢!

推荐答案

您数据类型'text'应该为xml, json, script, or html

有关更多信息,请参见 jQuery的帖子文档

for more information see jQuery's post documentation

这篇关于移动浏览器中的jquery帖子不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆