Results 1 to 7 of 7

Thread: Ext.data.JsonP.request not working

  1. #1
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
      0  

    Default Ext.data.JsonP.request not working

    Hello,

    I am using Sencha Touch 2 and Phonegap (Cordova 1.5) together and when I want to do a JsonP request i get the following error in XCODE:
    Code:
    [INFO] Error in success callback: org.apache.cordova.camera1 = TypeError: 'undefined' is not an object
    This is my code:

    Code:
    function takePhoto()
    {
        navigator.camera.getPicture(onSuccess, onFail, { 
            quality: 50,
            destinationType: Camera.DestinationType.DATA_URL
        }); 
    
    
        function onSuccess(imageData) {
            var image = document.getElementById('myImage');
            
            // Make the JsonP request
                Ext.data.JsonP.request({
                url: 'http://free.worldweatheronline.com/feed/weather.ashx',
                callbackKey: 'callback',
                params: {
                    key: '23f6a0ab24185952101705',
                    q: '94301', // Palo Alto
                    format: 'json',
                    num_of_days: 5
                },
                success: function(result) {
                    alert('Success!!');
                }
            });
        }
    
    
        function onFail(message) {
            alert('Failed because: ' + message);
        }
    }
    When I leave the JsonP request away, everything is working fine. What am I doing wrong?

    Thanks in advance!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    Is Ext.data.JsonP loaded/required?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User steffenbrem's Avatar
    Join Date
    Mar 2012
    Posts
    36
    Vote Rating
    2
      0  

    Default

    No, not at all...

    Thanks xDD

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Location
    Chandigarh (INDIA)
    Posts
    143
    Vote Rating
    0
      0  

    Default

    Hii...

    I am getting same issuee if you are able to solve it plz let me know.

    Urgent.....

    Regards
    Sachin Sachdeva.

  5. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    Quote Originally Posted by sachin sachdeva View Post
    Hii...

    I am getting same issuee if you are able to solve it plz let me know.

    Urgent.....

    Regards
    Sachin Sachdeva.
    Require JsonP class
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #6
    Sencha User
    Join Date
    Oct 2010
    Location
    Chandigarh (INDIA)
    Posts
    143
    Vote Rating
    0
      0  

    Default

    But i am using MVC Getting started example provided on sencha website.

    Can you plz let me know how can i include class through that.

    Just provide me a hint so that i can implement the same ASAP.

    Regards
    Sachin Sachdeva,

  7. #7
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    With one of the require means like Ext.require
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •