Reputation: 653
Currently, I am creating a webpage which use search tool of Google.com. - I made a form on the page which will sent query form to Google.com. - For the search result, I used I an iframe to display those content.
But the problem is: when the iframe displays search result links, If user click on those link, only the content in the iframe got redirect to the result webpage, while I want the link to redirect the main page itself.
Is there a solution for this ?
The code for my main page - The searchFrame is where the form is - The contentFrame is just an empty page.
'
<div id="sidecontainer">
<iframe id="SFrame" name="SearchFrame" frameborder ="0" width="500" height="100" scrolling="no" src="SearchBox.html"></iframe>
</div>
<div id="content">
<iframe id="CFrame" name="ContentFrame" frameborder="0" width="80%" height="900px" scrolling="no" OnLoad="window.scroll(0, 0);" src="ContentFrame.html"></iframe>
</div>
'
Cheers
Upvotes: 0
Views: 1266
Reputation: 2515
Use base tag. Add this to the head of the iframe. This will open all the links in the parent page itself
<base target="_parent" />
This is supported in all browsers too.
Upvotes: 1