Results 1 to 2 of 2

Thread: Cross domain request through JSONP

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default Cross domain request through JSONP

    Hi..

    I want to display html pages from external domains but unable to do this through JSONP i.e page doesn't contain anything. It just shows a blank page. Please find my code below for the same.
    Code:
     Ext.util.JSONP.request({
                    
                    url:wikiurl,
                    callbackKey:'callback',
                    params:{},
                    callback:function(data){
                        console.log(data);
                        console.log("inside callback");
                    },
                    success:function(result,opts){
                        console.log(result);
                    },
                       failure:function(result,opts){
                        console.log(result);
                    }
                });

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

    Default

    JSONP request is going to expect JSON wrapped in a callback method. Like

    Code:
    Ext.data.JsonP.callback1({"foo": "bar"});
    So HTML pages won't be able to work.
    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
  •