Bug Tracker

Opened 7 years ago

Closed 5 years ago

#5354 closed bug (invalid)

$(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 (last modified by dmethvin)

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);
}

Change History (3)

comment:1 Changed 6 years ago by dmethvin

  • Description modified (diff)

comment:2 Changed 6 years ago by dmethvin

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

comment:3 Changed 5 years ago by snover

  • Resolution set to invalid
  • Status changed from new to closed

Closing after 11 months with no testcase.

Note: See TracTickets for help on using tickets.