Find the window of an element inside an iframe
Is there a cross browser method of returning the window object of an element whether it be in an iframe.
Thi开发者_开发技巧s does the job for me but I don't know how well supported it is or if jQuery has a solution.
var edoc = elem.ownerDocument.defaultView || elem.document.parentWindow;
Your code should work in all major browsers. To clarify it - the first part is for non-IE browsers while the second targets IE. To the best of my knowledge jQuery does not provide a shortcut for that code.
Use frame.contentWindow
var win = iframeElement.contentWindow;
精彩评论