日期:2014-05-17  浏览次数:20706 次

请问如何通过连接打开一个frame并打开指定页面
也就是通过连接打开一个frame的页面
并且在规定框架打开指定页面
除了服务器端判断

------解决方案--------------------
给你个思路,没试不知道如何?
b.html连接大概内容应该是
<a href= "a.html?url=new.html "> 在a.html中打开new.html </a>

a.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>
<script language= "javascript ">
function getPram(source, name)
{
var reg = new RegExp( "(^|\\?|&) "+ name + "=([^&]*)(\\s|&|$) ", "i ");

if (reg.test(source)) return RegExp.$2; return " ";
}
function view(){
vu=location.href
url=getPram(vu, "url ");
document.getElementById( "main ").src=url;
}
</script>
</head>
<script language= "javascript ">
function getPram(source, name)
{
var reg = new RegExp( "(^|\\?|&) "+ name + "=([^&]*)(\\s|&|$) ", "i ");

if (reg.test(source)) return RegExp.$2; return " ";
}
vu=location.href
url=getPram(vu, "url ");
document.writeln( " <frameset rows=\ "80,*\ " frameborder=\ "no\ " border=\ "0\ " framespacing=\ "0\ "> ");
document.writeln( " <frame src=\ "top.html\ " name=\ "topFrame\ " scrolling=\ "No\ " noresize=\ "noresize\ " id=\ "topFrame\ " \/> ");
document.writeln( " <frame src=\ " "+url+ "\ " name=\ "mainFrame\ " id=\ "mainFrame\ " \/> ");
document.writeln( " <\/frameset> ");
document.writeln( " <noframes> ");
}
</script>
<body>
</body>
</noframes> </html>