catbelly
catbelly

Reputation: 500

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

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

Upvotes: 0

Views: 2332

Answers (4)

Anthony
Anthony

Reputation: 11

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.

Upvotes: 1

catbelly
catbelly

Reputation: 500

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.

Upvotes: 0

Quintin Robinson
Quintin Robinson

Reputation: 82375

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.

Upvotes: 0

zsalzbank
zsalzbank

Reputation: 9867

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/ajaxError/

Upvotes: 0

Related Questions