In javascript how do I get a handle on the frame that I’m in based on an element in that frame?
function myFunction(elementInFrame){ // here I want to get a handle on the frame that elementInFrame lives in }
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.
elementInFrame.document.defaultView for non-IE browsers.
(It’s not quite a standard part of the DOM; DOM Level 2 Views says the property exists but doesn’t explicitly say it points to ‘window’, since the DOM standard currently known nothing about the window object.)