JQuery Mobile和AJAX Post的問題

[英]Problem with JQuery Mobile and AJAX Post


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?:

我對這個問題感到難過,出於某種原因只在黑莓上,我沒有在帖子上打出內在的“功能”。我正在使用最新的JQuery Mobile。有人有想法嗎?:

function test(data1)
    {            
        alert("I do get here!");
        $.post("test.php",
        { data: data1 },
            function(xml) {
                alert("never here!");
            }
        );     
    }

4 个解决方案

#1


1  

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.

我也有這個問題,但只有5.x操作系統。 6.0工作正常。無論出於何種原因,在我的情況下從IIS返回的數據導致帖子看起來沒有成功 - 盡管它顯然是這樣。

#2


0  

That will only happen onSuccess. Add an error handler to see what is going wrong.

這只會發生在成功。添加錯誤處理程序以查看出錯的地方。

http://api.jquery.com/jQuery.ajax/

http://api.jquery.com/jQuery.ajax/

http://api.jquery.com/ajaxError/

http://api.jquery.com/ajaxError/

#3


0  

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 straight ajax() call or setting the ajaxError() or ajaxComplete() callbacks to see if there is an actual issue.

最可能的原因是調用不會導致成功,並且只有在成功的情況下才會調用為post()輔助方法指定的回調。嘗試將調用解包為直接的ajax()調用或設置ajaxError()或ajaxComplete()回調以查看是否存在實際問題。

#4


0  

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.

解決方案最終是將方法更改為GET。我不確定為什么但Blackberry瀏覽器似乎不支持JQuery POST。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2010/12/22/72fd435808162bb1f83e6eb5e95d6710.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com