Click to See Complete Forum and Search --> : Open page from an iframe


galois
07-30-2006, 02:11 PM
Hi all,
I am new to this forum and I hope that I could learn a lot from you experts. Currently, I have some problem with Javascript and I believe that you can help me solve them easily since you are much more experienced than me.

I have the following 2 html files:

parent.html:

<html>
<body>
<iframe src="child.html"></iframe>
</body>
</html>


test.html:

<html>
<body>
<a href="http://www.google.com" target="javascript:opener">Google</a>
</body>
</html>


When I open parent.html, it shows an iframe containing child.html. When I click on the Google link in the iframe, Google is loaded into a new browser window. The result is the same if I use "javascript:window.parent" instead of "javascript:opener".

Could you please tell me how could I make it to be loaded into the current browser window? Thank you very much!

Cheers,
Galois

Charles
07-30-2006, 02:16 PM
<a href="http://www.google.com" target="javascript:opener">Google</a>That opens a new window named "javascript:opener" and you gett the behavior that you have noted. You can't just go throwing JavaScript at things and in particular as the value of some "target" attribute. Try <a href="http://www.google.com" target="_parent">Google</a>And see http://www.w3.org/TR/REC-html40/types.html#type-frame-target .

galois
07-30-2006, 07:34 PM
It works! Thank you very much!