Bug Tracker

Ticket #5354 (closed bug: invalid)

Opened 5 years ago

Last modified 4 years ago

$(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:
Blocking: Blocked by:

Description (last modified by dmethvin) (diff)

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

jquery-iframe_contents.png Download (142.8 KB) - added by tyson-benson 5 years ago.
IE Developer Toolbar

Change History

Changed 5 years ago by tyson-benson

IE Developer Toolbar

comment:1 Changed 5 years ago by dmethvin

  • Description modified (diff)

comment:2 Changed 5 years ago by dmethvin

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

comment:3 Changed 4 years ago by snover

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

Closing after 11 months with no testcase.

Note: See TracTickets for help on using tickets.