Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: [CLOSED][3.0rc1] Panel autoLoad IE issue

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Jul 2008
    Posts
    12
    Vote Rating
    0
      0  

    Default [CLOSED] [3.0rc1] Panel autoLoad IE issue

    Hi everyone.
    When loading html content into a Panel with autoLoad, IE (6,7 & 8) seems to ignore what's between the <script></script> tags.

    For example:
    Code:
    function addTab(tabId,tabTitle, targetUrl){
     tabPanel.add({
     id: tabId,
     title: tabTitle,
     autoLoad: {url: targetUrl, callback: this.initSearch, scope: this, scripts: true},
     closable:true
    }).show(); }
    file.js (the file to load)
    Code:
    <script type="text/javascript">
    Ext.MessageBox.alert('Test','Hello world');
    </script>
    <div id='div_test'>Hello div</div>
    This works fine in FF, but in IE don't (only shows the 'Hello div').
    Thanks!

  2. #2
    Sencha User thesilentman's Avatar
    Join Date
    Apr 2007
    Location
    Athens, Greece
    Posts
    232
    Vote Rating
    2
      0  

    Exclamation Problems with autoload in Internet Explorer 6,7

    I have the same issue in a quick and dirty (not that dirty!!) app I am programming now with 3.0. The code has been checked with jslint and is ok (no extra commas or such).
    However autoload isn't triggering loading from the server.
    It seems to crash where the innerHTML is assign the indicatortext.
    I traced the error and IE fails here =>ext-all-debug.js:6142 with an 'unknown runtime error'.

    Code:
    6140	    showLoading : function(){
    6141	        if(this.showLoadIndicator){
    6142            	this.el.dom.innerHTML = this.indicatorText;
    6143	        }
    6144	    },

    However if I disable the indicator: Ext.Updater.defaults.showLoadIndicator=false;


    the error moves further down the rabbithole.... (since I am also embedding script.....)


    Code:
    2897       });
    2898        dom.innerHTML = html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");
    2899        return this;
    As if there is a problem with the dom.innerHTML in ie....


    The code works in all browsers except ie 6,7. I have not tested 8 yet.

    ExtJS Version : 3.0 RC1

    Any ideas?

    CU,
    Frank

  3. #3
    Sencha User thesilentman's Avatar
    Join Date
    Apr 2007
    Location
    Athens, Greece
    Posts
    232
    Vote Rating
    2
      0  

    Exclamation

    Well, the issue with the unknown runtime error is gone...
    I had a forgotten bodyCfg in place that had a wrong tag type ('p') and internet explorer didn't like it...
    The strange thing is that all the other browsers didn't have an issue with that.

    The execution of scripts issue is still there as normanhab101 stated in the beginning of this thread.

    I set up a quick example for that here:
    http://frankmayer.net/ext/ext30/exam...ow/hello2.html

    Cheers,
    Frank

  4. #4
    Sencha User bt_bruno's Avatar
    Join Date
    Mar 2008
    Location
    Redwood City, CA
    Posts
    154
    Vote Rating
    11
      0  

    Default

    Quote Originally Posted by normanhab101 View Post
    ...
    file.js (the file to load)
    Code:
    <script type="text/javascript">
    Ext.MessageBox.alert('Test','Hello world');
    </script>
    <div id='div_test'>Hello div</div>
    ...
    If you have a js file you should not use any HTML tags as <script> or <div>.

    EDITED:

    Anyway, I did some tests and it really doesn't load scripts...

    bug.html
    Code:
    new Ext.TabPanel({
    	 renderTo	: Ext.getBody()
    	,width		: 300
    	,height		: 300
    	,items		: [{
    		 title		: 'Test'
    		,autoLoad	: {
    			 url		: 'bug2.html'
    			,callback	: function(){ alert('callback!') }
    			,scripts	: true
    		}
    		,listeners:{
    			beforerender:function(){ debugger; }
    		}
    	}]
    })
    bug2.html
    Code:
    <script type="text/javascript">
    	Ext.MessageBox.alert('Test','Hello world');
    </script>
    <div id='div_test'>Hello div</div>
    Seems that Element.update method has some trouble... It wrappers the autoLoad responde in a <span> and uses the Ext.lib.Event.onAvailable to wait until is avaible soo can work with the scripts tag. The problem is, Ext.lib.Event.onAvailable doesn't executes.

    Code:
    update:function()
    {
       ...
      html += '<span id="' + id + '"></span>';
    
      Ext.lib.Event.onAvailable(id, function(){ ... });
      ...
    }
    It's too advanced for me to figure out what's wrong, but I think this is the way

  5. #5
    Sencha User thesilentman's Avatar
    Join Date
    Apr 2007
    Location
    Athens, Greece
    Posts
    232
    Vote Rating
    2
      0  

    Default

    Hello bt_bruno,
    thanks for getting into this.
    The file.js in the initial bug report was misleading. It should have been something .html.

    As the update method's documentation states [scripts config option]:
    scripts : Boolean
    If true any <script> tags embedded in the response text will be extracted and executed (defaults to Ext.Updater.defaults.loadScripts). If this option is specified, the callback will be called after the execution of the scripts.

    so yes, the <scripts> tags must be there... as this updates the body of the element and should be valid html without the <HTML> and <BODY> tags, since they already exist in the document.

    [EDIT]: But you knew that already

    Cheers,
    Frank

  6. #6
    Ext User
    Join Date
    Jul 2008
    Posts
    12
    Vote Rating
    0
      0  

    Default

    I need the HTML because there is some PHP involved to handle sessions, mysql and stuff.
    Like thesilentman said it's a HTML without <html> and <body> tags, but with a <script> that is completely ignored by IE.

    TIP: dont ask me how, but I opened the app in IE, go to some internet site in the same window, and go back to my app with <-, then worked!

  7. #7
    Sencha User thesilentman's Avatar
    Join Date
    Apr 2007
    Location
    Athens, Greece
    Posts
    232
    Vote Rating
    2
      0  

    Default

    Yes,
    I had that experience, too!!!

    Breathtaking isn't it?
    As I finished answering this thread earlier I went back to test something, did just a reload and it suddenly worked. But only one time..
    When I reloaded again it didn't!! Same thing happened on IE7 and on a virtual machine with IE8.

    Ghosts? Black Magic? The thing with the dolls and the needles?

    Cheers,
    Frank

  8. #8
    Ext User
    Join Date
    Jul 2008
    Posts
    12
    Vote Rating
    0
      0  

    Default

    is frightening!
    I guess there is a thing when the page is cached...

  9. #9
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,185
    Vote Rating
    1000
      0  

    Default

    Confirmed, this seems to be happening "at random" on IE. The weird thing is, if I include Ext.Lib.Event after ext-all-debug, before my test code:

    Code:
    Ext.Lib.Event = {.....};
    Ext.onReady(function(){
        var p = new Ext.Panel({
            width: 400,
            height: 400,
            renderTo: document.body,
            autoLoad: {url: 'x.html', scripts: true}
        });
    });
    It works every time.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  10. #10
    Ext User
    Join Date
    Jul 2008
    Posts
    12
    Vote Rating
    0
      0  

    Default

    evant, thank you very much!
    the workaround works perfectly, added de js like this:

    Code:
    <script type="text/javascript" src="adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="adapter/ext/ext-all.js"></script>
    <script type="text/javascript" src="adapter/ext/ext-base-event-min.js"></script>
    and works fine in IE6 IE7 & IE8

    anyway the bug needs to be solved

Page 1 of 2 12 LastLast

Posting Permissions

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