If I have
var doc=window.document;
and I don’t want to define another variable, how can I refer to window?
doc.parentNode does not work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
document.defaultView[MDN] should work, but of course not in IE (until IE9). But it seems you can usedocument.parentWindowthere.So cross-browser would be: