Skip to main content

Bug Tracker

Side navigation

#5354 closed bug (invalid)

Opened October 12, 2009 04:39AM UTC

Closed November 19, 2010 08:17AM UTC

$(iframe).contents() not returning document element for IE8

Reported by: tyson-benson Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: iframe,contents Cc:
Blocked by: Blocking:
Description

I was using the .contents() function to return the DispHTMLDocument, however in IE8 the elem.contentWindow.document did not exist in the DispHTMLWindow2 object.

The problem lies on line 1186:

contents: function(elem){
return jQuery.nodeName(elem,"iframe")?
  elem.contentDocument ||  elem.contentWindow.document:
  jQuery.makeArray(elem.childNodes);
}

Perhaps it should be like this:

contents: function(elem){
  return jQuery.nodeName(elem,"iframe")?
  elem.contentDocument || elem.contentWindow.document || elem.document :
  jQuery.makeArray(elem.childNodes);
}
Attachments (1)
Change History (3)

Changed December 10, 2009 04:19AM UTC by dmethvin comment:1

description: I was using the .contents() function to return the DispHTMLDocument, however in IE8 the elem.contentWindow.document did not exist in the DispHTMLWindow2 object. \ \ The problem lies on line 1186: \ contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} \ \ Perhaps it should be like this: \ contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document||elem.document:jQuery.makeArray(elem.childNodes);} \ I was using the .contents() function to return the DispHTMLDocument, however in IE8 the elem.contentWindow.document did not exist in the DispHTMLWindow2 object. \ \ The problem lies on line 1186: \ {{{ \ contents: function(elem){ \ return jQuery.nodeName(elem,"iframe")? \ elem.contentDocument || elem.contentWindow.document: \ jQuery.makeArray(elem.childNodes); \ } \ }}} \ Perhaps it should be like this: \ {{{ \ contents: function(elem){ \ return jQuery.nodeName(elem,"iframe")? \ elem.contentDocument || elem.contentWindow.document || elem.document : \ jQuery.makeArray(elem.childNodes); \ } \ }}} \

Changed December 16, 2009 02:47AM UTC by dmethvin comment:2

Can you provide a test case, or offer some more context about when this problem occurs?

Changed November 19, 2010 08:17AM UTC by snover comment:3

resolution: → invalid
status: newclosed

Closing after 11 months with no testcase.