Results 1 to 3 of 3

Thread: JSONP return html page from different URL

  1. #1
    Sencha Premium User
    Join Date
    Mar 2017
    Posts
    9

    Default JSONP return html page from different URL

    Hi,

    I want to call a different URL to get content of an html page and show it a panel. Is there something like JSONP to load actual html content?

    Since I am returning "text/html" it fails of validation.

    Code:
    Ext.data.JsonP.request({
                    scope: this,
                    timeout: 60000,
                    url: 'http://localhost:8080/sadevio/api/localhost/123/help/'+id,
                    callbackKey: "callback",
                    callback: function(success, data) {
                        if(success){
                            var data = data.data;
                            
                            var tab = tabPanel.add({
                                itemId: 'tab' + id,
                                closable: true,
                                autoScroll: true,
                                xtype: 'panel',
                                layout: {
                                    type: 'fit'
                                },
                                title: title,
                                html: response.responseText,
                                listeners: {
                                click : {
                                    fn : function(e, t) {
                                        tabPanel.fireEvent('click',this,e,t);
                                    },
                                    element : 'el',
                                    scope : this
                                }
                                }
                            });
                            
                            tabPanel.setActiveTab(tab);
                        }
                    }
                });
    response from server

    Code:
    Ext.data.JsonP.callback6( <html> <head> 
    <META http-equiv="Content-Type" content="text/html; charset=utf-8"> .....
    Response header

    Code:
    HTTP/1.1 200Content-Type: application/javascriptTransfer-Encoding: chunkedDate: Tue, 30 Apr 2019 18:05:05 GMT

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,005
    Answers
    5

    Default

    Thank you so much for your post. I apologize for the delay. I have shared this with the support staff to look into at their earliest convenience. Your patience is greatly appreciated!

    Thanks again,

    Michele


  3. #3
    Sencha User
    Join Date
    Oct 2014
    Posts
    15

    Default

    The JsonP proxy requires you to send JSON values in the JsonP callback.
    Is there a reason for you to use JsonP in the first place?

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
  •