Jump to content

In frameset the links to open in the other frame


Amruta Gupta

Recommended Posts

Hi...create following file with given code:and then try to run frame.html u will get the things...-----------------------------------------------filename: frame.html-----------------------------------------------<html><frameset cols="20%,80%"><frame src="frame1.html"><frame src="frame2.html" name="showframe"></frameset><noframes></noframes></html>-----------------------------------------------filename: frame1.html-----------------------------------------------<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head><body><ul> <li><a href="link1.html" target="showframe">link1</a></li> <li><a href="link2.html" target="showframe">link2</a></li> <li><a href="link3.html" target="showframe">link3</a></li></ul></body></html>-----------------------------------------------filename: frame2.html-----------------------------------------------<!-- This is blank here we put the targe page from left link--->-----------------------------------------------filename: link1.html-----------------------------------------------This is content for link1-----------------------------------------------filename: link2.html-----------------------------------------------This is content for link2-----------------------------------------------filename: link3.html-----------------------------------------------This is content for link3Regards,Vijay

Link to comment
Share on other sites

The short version is to give frame B a name attribute, for example:

<frame src="url.html" name="frame_b" />

And then, when you want a link to open in frame B when the link is in another frame, give the link the attribute target="frame_b":

<a href="newurl.html" target="frame_b">Link text</a>

If the link is in frame B and you want to force it to open in frame B as well, use the keyword _self for the target attribute:

<a href="newurl.html" target="_self">Link text</a>

Link to comment
Share on other sites

  • 2 weeks later...

Thank you so much for the short and quick response that helped me a lot.

The short version is to give frame B a name attribute, for example:
<frame src="url.html" name="frame_b" />

And then, when you want a link to open in frame B when the link is in another frame, give the link the attribute target="frame_b":

<a href="newurl.html" target="frame_b">Link text</a>

If the link is in frame B and you want to force it to open in frame B as well, use the keyword _self for the target attribute:

<a href="newurl.html" target="_self">Link text</a>

Link to comment
Share on other sites

Thank you so much for the short and quick response that helped me a lot.

The short version is to give frame B a name attribute, for example:
<frame src="url.html" name="frame_b" />

And then, when you want a link to open in frame B when the link is in another frame, give the link the attribute target="frame_b":

<a href="newurl.html" target="frame_b">Link text</a>

If the link is in frame B and you want to force it to open in frame B as well, use the keyword _self for the target attribute:

<a href="newurl.html" target="_self">Link text</a>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...