Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load new page from link on frame?

Status
Not open for further replies.

megmoo75

Programmer
Jun 14, 2003
40
0
0
US
I am editing some code that someone else developed and don't know a whole lot about frames. The page I'm editing is using frames and along the left side frame there is a group of navigation buttons. Normally one would want those buttons/frame to stay displayed as users click on the buttons to get around the site. However, I need a couple of the buttons to send the users to an entirely new site as if they had typed in the new site's URL manually (no knowledge or link back to my site).

This is the code (with the actual site I'm going to changed) for that link as it is now:

<a onclick=&quot;openPage(' >
<img name=&quot;img1&quot; border=&quot;0&quot; src=&quot;images/why.gif&quot; border=&quot;0&quot;></a><br>

What happens is when the user clicks the button, the left side frame itself loads the new page and the rest of the page remains the same as what it was.

I'm sure this is an extremely easy thing, but I'm just not familiar with frames, so any assistance, links, etc you can provide would be great!

Thanks in advance.

Megan
 
I don't know what the openPage function does, but you basically want the target attribute to be &quot;_top&quot;
 
Could you post the OpenPage function?

Basically what you have to do in the openpage function is this:

Code:
window.parent.location = &quot;[link here]&quot;;
instead of where it has
Code:
document.location = &quot;[link here]&quot;;

Take Care,
Mike
 
Thanks for the replies. The _top works perfect. So, for future readers of this post, I had:

<a onclick=&quot;openPage(' >
<img name=&quot;img1&quot; border=&quot;0&quot; src=&quot;images/why.gif&quot; border=&quot;0&quot;></a><br>

and changed it to:

<a href = &quot; target = &quot;_top&quot;> <img src=&quot;images/home.gif&quot; border=&quot;0&quot; name=&quot;links&quot; border=&quot;0&quot;></a>

Also, I found this article that helped:


Thanks for the help!!
 
I had a typo in my previous post - there shouldn't be a semi-colon after the URL. It should be:

<a href = &quot; target = &quot;_top&quot;> <img src=&quot;images/home.gif&quot; border=&quot;0&quot; name=&quot;links&quot; border=&quot;0&quot;></a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top