日期:2014-05-16  浏览次数:20592 次

框架问题
浏览器中指定了两个框架,左边是树型结构的链接导航,右边是所指定的网页。
    问题:生成的右边的网页并非是我自己写的,即左边的导航地址是任意指定,当点击某一个地址时,生成的网页有时会在我指定的右边的窗口,有时它会新建一个新的窗口,我如何才能将那些新建的网页窗口强行让它只显示在我右边的窗口。
    请大家帮忙!在下不胜感激!
                                                                                                    刘锡生
                                                                                                                    2007-1-4

------解决方案--------------------
在左边窗口的 <head> </head> 之间加上
<base target= "右边框架的ID ">
------解决方案--------------------
<a href=“example1.htm” target=“_blank“> this is a link </a> 在新的窗口打开。

target=框架名称:在指定框架打开
target=_self:在本框架页面打开
target=_top:跳出框架在本页面打开
target=_top= "_blank " 在新窗口打开
------解决方案--------------------
---example.html----
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>

<frameset rows= "* " cols= "184*,798* " framespacing= "0 " frameborder= "no " border= "1 ">
<frame src= "left.html " name= "leftFrame " id= "leftFrame " title= "left " />
<frame src= "right.html " name= "mainFrame " id= "mainFrame " title= "right " />
</frameset>
<noframes> <body>
</body>
</noframes> </html>

-------left.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=gb2312 " />
<title> 无标题文档 </title>
</head>

<body bgcolor= "#FFFFCC ">
<p> <a href= "example1.htm " target= "mainFrame "> example1.htm </a> </p>
<p> <a href= "example2.htm " target= "mainFrame "> example2.htm </a> </p>
<p> <a href= "example3.htm " target= "mainFrame "> example3.htm </a> </p>
<p> <a href= "example4.htm " target= "mainFrame "> example4.htm </a> </p>
<p> <a href= "example5.htm " target= "mainFrame "> example5.htm </a> </p>
<p> <a href= "example6.htm " target= "mainFrame "> example6.htm </a> </p>
<p> <a href= "example7.htm