Carrying out the actions of an input type button element in the parent frame
I've an iFrame A whi开发者_开发知识库ch has an iFrame B inside it. In frame B i load a page which has a input type button element. It basically, when gets clicked, navigates to another page. Now i want to change the target of the button so that i loads the page in its parent iFrame A.
I've tried changing
currentButton.target = '_parent'
But it is not working. Any ideas?
- If the page in iframeB is not from your domain, you can only change its behaviour by reading the complete page on the server, modify the behaviour and serve it as if it came from your server.
- If it comes from your server, then I do not see how you cannot change the behaviour. If you cannot do 1) then the answer is "not possible"
The following will do it:
parent.location.href = "your url here";
精彩评论