You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Alan Neveu (Created) (JIRA)" <ji...@apache.org> on 2012/01/31 05:28:10 UTC

[jira] [Created] (CB-208) WP7 + JQuery call to $.ajax does not work

WP7 + JQuery call to $.ajax does not work
-----------------------------------------

                 Key: CB-208
                 URL: https://issues.apache.org/jira/browse/CB-208
             Project: Apache Callback
          Issue Type: Bug
          Components: WP7
    Affects Versions: 1.4.0
         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
            Reporter: Alan Neveu
            Assignee: Jesse MacFadyen


My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.

It looks like the error is happening on the line that says:

return this.wrappedXHR.send(data);

Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesus Bosch (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231077#comment-13231077 ] 

Jesus Bosch commented on CB-208:
--------------------------------

ah, the log says: 

Log:"XMLHttpRequest.open ::: content.json"
Log:"Wrapped XHR received Error from FileAPI :: [object Object]"

And cordova is 1.5.0, thanks
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200523#comment-13200523 ] 

Alan Neveu commented on CB-208:
-------------------------------

Okay, I'm ignorant..  Jesse what exactly is meant by "5c2310edb0dfaf19f64cc53c0fea4e6fd080959b"... Happy to learn, just need a little help.
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Neveu updated CB-208:
--------------------------

    Attachment: json2.js

This is a custom JSON script from Rick Strahl that deals properly with Microsoft formatted dates, in both directions.
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesus Bosch (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231074#comment-13231074 ] 

Jesus Bosch commented on CB-208:
--------------------------------

sorry but not working on wp7 with cordova 1.5... 

navigator.notification.alert("readingjson");

            $.support.cors = true;

            $.ajax({
                url: "content.json",
                dataType: 'json',
                success: function (a) {
                    navigator.notification.alert("json readed");
                }
            });

            navigator.notification.alert('yeah');


"json readed" alert is never showed... and that json file is being readed without problems on a normal browser or even on iOS version of PhoneGap
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesse MacFadyen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse MacFadyen closed CB-208.
------------------------------

    
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13203586#comment-13203586 ] 

Alan Neveu commented on CB-208:
-------------------------------

Confirming - this commit resolved this problem. Thanks again.
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesse MacFadyen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200548#comment-13200548 ] 

Jesse MacFadyen commented on CB-208:
------------------------------------

That was the commit in git.
You can get the file here:
https://github.com/purplecabbage/callback-windows-phone/blob/master/framework/js/PGXHR.js
It has not been rebuilt into phonegap.js, so you will need to do this yourself for your project.

                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesse MacFadyen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199874#comment-13199874 ] 

Jesse MacFadyen commented on CB-208:
------------------------------------

also, in the meantime, if you restructure your code to call open()
before setRequestHeader() it should work.

Cheers,
  Jesse

Sent from my iPhone5

On 2012-02-03, at 8:31 AM, "Alan Neveu (Commented) (JIRA)"


                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200646#comment-13200646 ] 

Alan Neveu commented on CB-208:
-------------------------------

Ahh, I figured as much, thanks!

AN

Sent from my iPhone



                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196939#comment-13196939 ] 

Alan Neveu commented on CB-208:
-------------------------------

Here is the serviceProxy function I am using that calls the JQuery $.ajax function. This function, in turn, uses the JSON2.js script that I have attached to this case.

// *** Service Calling Proxy Class
function serviceProxy(serviceUrl) {
    var _I = this;
    this.serviceUrl = serviceUrl;

    // *** Call a wrapped object
    this.invoke = function (method, data, callback, error, bare) {
        // *** Convert input data into JSON - REQUIRES Json2.js
        var json = JSON2.stringify(data);
        //json = data;

        // *** The service endpoint URL        
        var url = _I.serviceUrl + method;
        
        $.ajax({
            url: url,
            data: json,
            type: "POST",
            processData: false,
            contentType: "application/json",
            timeout: 20000,
            dataType: "json",  // not "json" we'll parse
            success:
                    function (res) {
                        if (!callback) return;

                        // *** Use json library so we can fix up MS AJAX dates
                        var result = JSON2.parse(res);
                        // *** Bare message IS result
                        if (bare)
                        { callback(result); return; }

                        // *** Wrapped message contains top level object node
                        // *** strip it off
                        callback(result);
                    },
            error: function (xhr) {
                if (!error) return;
                if (xhr.responseText) {
                    var err = JSON2.parse(xhr.responseText);
                    if (err)
                        error(err);
                    else
                        error({ Message: "Unknown server error." })
                }
                return;
            }
        });
    }
}
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesse MacFadyen (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse MacFadyen resolved CB-208.
--------------------------------

    Resolution: Fixed

5c2310edb0dfaf19f64cc53c0fea4e6fd080959b
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesse MacFadyen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse MacFadyen updated CB-208:
-------------------------------

    Fix Version/s: 1.5.0
    
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesse MacFadyen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196760#comment-13196760 ] 

Jesse MacFadyen commented on CB-208:
------------------------------------

Can you provide the custom $ajax function?
Other than that, I can only recommend that you store the reference to the original XHR before phonegap.js is included in the page.

ex.
var _XMLHttpRequest = XMLHttpRequest;
... include phonegap.js ...

Then in your $.ajax function, use 'new _XMLHttpRequest()', instead of XMLHttpRequest, which will be wrapped by phonegap.
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Jesse MacFadyen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199870#comment-13199870 ] 

Jesse MacFadyen commented on CB-208:
------------------------------------

Great! Yeah I can fix that, good find.

Cheers,
  Jesse

Sent from my iPhone5

On 2012-02-03, at 8:31 AM, "Alan Neveu (Commented) (JIRA)"


                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199826#comment-13199826 ] 

Alan Neveu commented on CB-208:
-------------------------------

I figured this out. Turns out the requestHeaders from my custom proxy were not being honored when PhoneGap hijacks the XHR. Using phonegap-1.4.0.js, I added this line of code:

this.wrappedXHR.setRequestHeader("Content-type","application/json");

just before line 3796, which is:

return this.wrappedXHR.send(data);

and that solved it.  Is there any way to craft the PhoneGap function so that it honors the requestHeaders that are already specified on the XHR before it hi-jacks it?  That might be a good solution.
                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199873#comment-13199873 ] 

Alan Neveu commented on CB-208:
-------------------------------

Awesome!

Sent from my iPhone



                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-208) WP7 + JQuery call to $.ajax does not work

Posted by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199905#comment-13199905 ] 

Alan Neveu commented on CB-208:
-------------------------------

Well, it's JQuery that calls the .open so I'd rather leave that part alone.  Thanks though!

AN

Sent from my iPhone



                
> WP7 + JQuery call to $.ajax does not work
> -----------------------------------------
>
>                 Key: CB-208
>                 URL: https://issues.apache.org/jira/browse/CB-208
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.4.0
>         Environment: VS.NET 2010, Using the latest code for the 1.4.0 release candidate, plus a fairly simple custom $.ajax function.
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>             Fix For: 1.5.0
>
>         Attachments: json2.js
>
>
> My own $.ajax function works great all by itself, but with phonegap-1.4.0.js present my $.ajax calls get hi-jacked and errors occur in that last function in phonegap-1.4.0.js.  If I comment out that whole function, my $.ajax calls work just great.  I need my custom $.ajax calls because they use some custom JSON code written by Rick Strahl that properly deals with Microsoft formatted dates going in and out of ASMX web services that use JSON for serialization.
> It looks like the error is happening on the line that says:
> return this.wrappedXHR.send(data);
> Is there any way I can disable the hi-jacking of $.ajax calls without modifying phonegap-1.4.0.js?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira