Search code examples
extjsextjs4linkedin-api

open a window with external javascripts in Extjs


I would like to open an Ext.Window in ExtJS, that will open an html file that contains external javascript from LinkedIn.

I have the following code:

Ext.create('Ext.window.Window', {
    title: 'About us',
    height: 400,
    width: 800,
    layout: 'fit',
    items: [{
        autoLoad: {
            url: 'linkedin_emp1.html',
            scripts: true
        }
    }]
}).show();

and the linkedin_emp1.html file is:

List of people

The html file is loaded and I see inside the window just the "List of People" string but not the content that comes from the linkedin javascript.

When I open the same html file from the browser I see everything fine.

It looks like I cannot run an external javascript inside an html.

Any ideas how to do that?


Solution

  • You can use iframe element using autoEl config inside of ExtJS.

    new Ext.Window({
        title : "About us",
        width : 400,
        height: 800,
        layout : 'fit',
        items : [{
            xtype : "component",
            autoEl : {
                tag : "iframe",
                src : "linkedin_emp1.html"
            }
        }]
    }).show();