I can get window.document
but how can I get document.window
? I need to know how to do this in all browsers.
The Window object is the top level object in the JavaScript hierarchy, so just refer to it as window
Edit: Original answer before Promote JS effort. JavaScript technologies overview on Mozilla Developer Network says:
In a browser environment, this global object is the window object.
Edit 2: After reading the author's comment to his question (and getting downvotes), this seems to be related to the iframe's document window. Take a look at window.parent and window.top and maybe compare them to infer your document window.
if (window.parent != window.top) {
// we're deeper than one down
}