jerromo / managediframe

Automatically exported from code.google.com/p/managediframe
0 stars 0 forks source link

win.location is not an Object at line 2696 on Safari #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I got this error after deleting an iframe and go back to previous state

Original issue reported on code.google.com by nhattieunhatkiem@gmail.com on 24 Nov 2009 at 10:41

GoogleCodeExporter commented 8 years ago
Could you describe the chain of events in more detail?

Code sample of the removal

Original comment by BeamG...@gmail.com on 24 Nov 2009 at 11:55

GoogleCodeExporter commented 8 years ago
It happen when I view a PDF file, I can post some code, hope it help:

    ,showHtmlView: function(url){
        if (!this._htmlPanel) {
            this._htmlPanel = new Ext.ux.ManagedIFrame.Panel({
                id: this.getId()+'-htmlPanel'
                ,border: false
                ,layout:'fit'
                ,useShim: true
                ,title: ''
            });
            this.add(this._htmlPanel);
        }
        this.layout.setActiveItem(this._htmlPanel);

        var frame = this._htmlPanel.getFrame();
        var d = new Date();
        var t= d.getTime();
        this._htmlPanel.setSrc(url + "&t=" + t, false, null, this);
        this.doLayout();
    }

I remove the htmlPanel when changing to another layout card and I got the error
"win.location is not an Object" on Safari. I dont get that error on IE8 and FF3

detailCardOnHide: function() {
        if (this._htmlPanel) {
            this.remove(this._htmlPanel);
            this._htmlPanel = null;
        }
}

My quick fix is at line 2696, I change

win.location.href = s;

into

if (win.location) win.location.href = s;

and I dont get that error anymore.

Original comment by nhattieunhatkiem@gmail.com on 1 Dec 2009 at 4:29

GoogleCodeExporter commented 8 years ago
Fixed in SVN.

Original comment by BeamG...@gmail.com on 21 Dec 2009 at 1:59