I try to click button on just opened page, but get TypeError: Cannot read property 'body' of undefined
var target = window.open("link");
target.document.body.getElementsByClassName("button class").item().click()
Could you please help?
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.
Depending on what
"link"is (at face value it is a page or servlet sibling to the main URL, but namedlink– however I suspect you are using it as a placeholder for something else) your main page may not have permission to access the document object, depending on the security policy as applied by the browser. For instance, you would see that error message normally iflinkwas replaced by a URL with a different domain from that of the main page.