0

extjs ウィンドウを最小化したい場合、IE8 では機能しません。他のすべてのブラウザは問題ありません。私が得るエラーは、これを含む行を指しています:

iframe.dom.hasOwnProperty

これはIE8では機能しないものですか?

またあります

iframe.dom.contentWindow.parentLostFocus();

IE のエラーは、「オブジェクトはオブジェクトをサポートしていません」と言っているだけです。何が問題なのかわからない。誰でもアイデアはありますか?

これが焦点です

iframe = Ext.get('iframe_{0}'.sprintf(item.itemId));
if(!iframe.dom.hasOwnProperty('contentWindow')) {
  return;
}

if(iframe !== null && iframe.dom && iframe.dom.contentWindow && iframe.dom.contentWindow.parentGotFocus) {
  context.trace('calling parentGotFocus in iframe {0}'.sprintf(item.itemId));
  iframe.dom.contentWindow.parentGotFocus();
} else {
  context.trace('function parentGotFocus not found in iframe {0}'.sprintf(item.itemId));
}
},
4

1 に答える 1

6

hasOwnProperty()IE8 以下はDOM 要素をサポートしていません。が DOM Node オブジェクトの場合iframe.dom、IE8 は「オブジェクトはプロパティまたはメソッドをサポートしていません」というエラーをスローします。エラーを回避するには、以下を置き換えてみてください。

iframe.dom.hasOwnProperty("property name");

と:

Object.prototype.hasOwnProperty.call(iframe.dom,"property name");
于 2012-08-30T12:41:11.083 に答える