You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jonathan Naguin (JIRA)" <ji...@apache.org> on 2013/08/28 12:00:52 UTC

[jira] [Commented] (CB-4681) jQuery Ajax callbacks not executed

    [ https://issues.apache.org/jira/browse/CB-4681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13752257#comment-13752257 ] 

Jonathan Naguin commented on CB-4681:
-------------------------------------

I have this working. I had to add this lines at the end of _changeReadyState_ method on _XHRHelper.cs_:

{code}
if (this.readyState == XHRShim.DONE){
    this.onload && this.onload();
}
{code}

It seems that onload is not fired automatically...
                
> jQuery Ajax callbacks not executed
> ----------------------------------
>
>                 Key: CB-4681
>                 URL: https://issues.apache.org/jira/browse/CB-4681
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP8
>    Affects Versions: 3.0.0
>         Environment: Windows 8 Professional
>            Reporter: Jonathan Naguin
>            Assignee: Jesse MacFadyen
>            Priority: Critical
>
> I have an Ajax request to a server, but the _success_ callback or any callback is not executed even if the server respond with a 200 code (I saw the logs using Wireshark).
> {code}
> $.ajax({
>     url: 'http://example.com',
>     data: { foo: 'bar' },
>     dataType: 'json',
>     success: function (data) { 
>         console.log(data); 
>     },
>     error: function(){
>         console.log("Error"); 
>     },
>     complete: function(){
>         console.log("Complete");
>     }
> });
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira