default.asp
<HTML>
<HEAD>
<TITLE>我的主页</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
</HEAD>
<%
'用来判断右侧Frame的显示页面
dim addr
addr=request("url")
if url="" then
url="left.htm"
end if
%>
<FRAMESET rows=81,*>
<FRAME name=Top scrolling=no src="top.htm">
<FRAMESET cols=238,* noresize>
<FRAME name=Left scrolling=no src=<%=url%>>
<FRAME name=Main src="index.htm">
</FRAMESET>
</FRAMESET>
</HTML>
index.htm
<html>
<head>
<script>
try{
if(parent.frames('Top'))
alert("存在mainFrame");
}
catch(e)
{ window.open("http://10.69.17.119/OpenFrame/default.asp?url='" + document.location + "'","_self");
}
</script>
</head>
<body οnlοad="LoadFrame();">
这是<h1>Index</h1>页面
</body>
</html>
chk.js
function LoadFrame()
{
try{
if(parent.frames('Top') && parent.frames('Left') && parent.frames('Main'))
alert("已经在Frame中开启网页");
}
catch(e)
{ window.open("http://10.69.17.119/OpenFrame/default.asp?url='" + document.location + "'","_self");
}
}
left.htm
<html>
<head>
</head>
<body >
这是<h1>Left</h1>页面
</body>
</html>
top.htm
<html>
<head>
</head>
<body">
这是<h1>Top</h1>页面
</body>
</html>
本例中只对index.htm进行了限制,如果有多个页面需要再处理!
相对比较简单没有太多的注释,希望能看懂!