0

when i want to minimize a extjs window it is not working in IE8. All the other browsers are fine. The error i get is pointing to a line with this in it:

iframe.dom.hasOwnProperty

Is this something that is not working for IE8?

also there is

iframe.dom.contentWindow.parentLostFocus();

The error in IE is just saying: object doesn't support object. Not sure what the issue could be. Anyone an idea?

this is the focus

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));
}
},
Rick Weller
  • 1,258
  • 9
  • 35
  • 54

1 Answers1

6

IE8 and less does not support hasOwnProperty() for DOM elements. If iframe.dom is DOM Node object, then IE8 throw an error "Object does not support property or method". To avoid error try to replace:

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

with:

Object.prototype.hasOwnProperty.call(iframe.dom,"property name");
Andrew D.
  • 8,130
  • 3
  • 21
  • 23