isXMLDoc: function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
- return ((elem.ownerDocument || elem).documentElement || 0).nodeName !== "HTML";
+ return ((elem ? elem.ownerDocument || elem : 0).documentElement || 0).nodeName !== "HTML";
},
// Evalulates a script in a global context
document.body.appendChild( iframe );
try {
- var body = jQuery(iframe).contents().find("body")[0];
- ok( !jQuery.isXMLDoc( body ), "Iframe body element" );
+ var body = jQuery(iframe).contents()[0];
+ ok( jQuery.isXMLDoc( body ), "Iframe body element" );
} catch(e){
- ok( false, "Iframe body element" );
+ ok( false, "Iframe body element exception" );
}
document.body.removeChild( iframe );