Helpful Information
 
 
Category: HTML
Help with hyperlink

Well, how can I place a link in the page1.html that opens page3.html in a frame placed in page2.html?

If you're using a frameset with page1 and page2, just use:
<a href="page3.html" target="[frame name]">(Link name)</a>
in page1, replacing [frame name] with the name of the frame page2 is in.

Thats not what i want Odin. What I need is an hyperlink in page1, clicking it opens page2 which have a frame and inside this frame apears page3. Do you understand?
Visit www.go2battle.com to see it, the links of the news in the main page don't open the new, open the page2 with the specified initial frame. What i want is a paramater that tells page2 which page must show in the frame.

Simple enough isn't it heimdall?

Make a hyperlink to a frame page... :)
Do you have FrontPage?

cr3ative

Right, I think I know what you mean. I can't think of an easy way to do it, or any easy way to pass the parameter, other than using the query string. This would be very easy in PHP, but in case you can't use it, try using this script in page2 to write the iframe or frameset.


Iframe:
<script type="text/javascript">
var url = String(window.location);
var match = url.match(/[?&]article=([^&#?]*)/)
var article = match[1]
document.write('<iframe name="article" src="'+article+'.html" height="400" width="400"></iframe>')
</script>

Frameset:
<script type="text/javascript">
var url = String(window.location);
var match = url.match(/[?&]article=([^&#?]*)/)
var article = match[1]
document.write('<frameset rows="100,*" name="news_frame"><frame name="news" src="article_header.html"><frame name="article" src="'+article+'.html"></frameset>')
</script>
Obviously, seen as the script writes the iframe/frameset itself, you'll need to change it to what you want to use.

Then on page1 you can use, taking it from go2battle:
<input type="button" onClick="window.open('page2.html?article=page3','News','width=400,height=400,scrollbars=yes,left=1,top=1')">

Or convert the link to text:
<a href="#" onClick="window.open('page2.html?article=page3','News','width=400,height=400,scrollbars=yes,left=1,top=1')">Link</a>

Replace page3 in your links with the page you want to load inside page2 (note that '.html' is automatically appended to the end).

Edit: Missed an ending tag










privacy (GDPR)