views:

14

answers:

2

Hello

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?

A: 

The following will do it:

parent.location.href = "your url here";
Tim Down
I cant alter the page elements behaivor.
NLV
mplungjan: iframe B's parent is iframe A, so calling that line in iframe B will load the new page into iframe A. Am I missing something?
Tim Down
Doh. No. I missed the first part of the sentence. Hence my parent.iframeA.location and not parent.location in my first comment
mplungjan
I've not designed the page that is getting loaded in iFrame B. I cant alter onClick events or whatever it is. I just cant alter the behavior. iFrame B has a input button 'cancel' which is when clicked goes back to a 'source url'. I want to load that source url in iFrame A instead of iFrame B. Hope you get it.
NLV
+1  A: 
  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"
mplungjan