這幾天在做Ext的時候,用firefug調試程序的時候老是提示錯誤,錯誤信息如下:
Permission denied to access property 'dom' from a non-chrome context
上網google了一下,中文的解析沒找到,經過一番折騰,在一個老外的帖子裏瞭解到一知半解。似乎只是firefug的的一個bug,3.5版本的火狐就會有這個問題,由於網絡延遲的問題,dom就出現了問題。這個老外牛人也提供瞭解決辦法,我拿過來,果真有效。解決方法如下:
Ext.override(Ext.Element, {
contains: function() {
var isXUL = Ext.isGecko ? function(node) {
return Object.prototype.toString.call(node) == '[object XULElement]';
} : Ext.emptyFn;
return function(el) {
return !this.dom.firstChild || // if this Element has no children, return false immediately
!el ||
isXUL(el) ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el);
};
}()
});
複寫Ext的Element方法就行了。
(轉載:http://www.cnblogs.com/lwjacky/archive/2009/11/02/1594508.html)
Permission denied to access property 'dom' from a non-chrome context
上網google了一下,中文的解析沒找到,經過一番折騰,在一個老外的帖子裏瞭解到一知半解。似乎只是firefug的的一個bug,3.5版本的火狐就會有這個問題,由於網絡延遲的問題,dom就出現了問題。這個老外牛人也提供瞭解決辦法,我拿過來,果真有效。解決方法如下:
Ext.override(Ext.Element, {
contains: function() {
var isXUL = Ext.isGecko ? function(node) {
return Object.prototype.toString.call(node) == '[object XULElement]';
} : Ext.emptyFn;
return function(el) {
return !this.dom.firstChild || // if this Element has no children, return false immediately
!el ||
isXUL(el) ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el);
};
}()
});
複寫Ext的Element方法就行了。
(轉載:http://www.cnblogs.com/lwjacky/archive/2009/11/02/1594508.html)