NLV
NLV

Reputation: 21651

Carrying out the actions of an input type button element in the parent frame

I've an iFrame A which 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?

Upvotes: 0

Views: 120

Answers (2)

mplungjan
mplungjan

Reputation: 178285

  1. 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.
  2. 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"

Upvotes: 1

Tim Down
Tim Down

Reputation: 324627

The following will do it:

parent.location.href = "your url here";

Upvotes: 0

Related Questions