jquery post in mobile browser doesn't work

倾然丶 夕夏残阳落幕 提交于 2019-12-11 16:52:33

问题


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');

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 ?

Thanks!


回答1:


you datatype 'text' should be xml, json, script, or html

for more information see jQuery's post documentation



来源:https://stackoverflow.com/questions/8062740/jquery-post-in-mobile-browser-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!