I need from document object or from a DOM element (i.e. a DIV) to know which is its window object.
In Firefox I can do:
document.documentElement.ownerDocument.defaultView
but obviously in that AWFUL browser that statement not work!!!
parentWindow. So:
var doc = el.ownerDocument;
var win = ('defaultView' in doc) ? doc.defaultView : doc.parentWindow;
var win = doc.defaultView || doc.parentWindow;
should do the trick too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With