建站代码网

热门标签

框架视图/ 无框架视图

想在你的网站提供一个常用的导航区链接,但是又不想占用宝贵的屏幕空间?把它放到框架里面吧。利用2个服务器变量http_referrer和script_name。在你的用户没有失去他们网站的当前的位置的情况下,你可以提供打入和进出帧的能力。
framepage.asp

<% '请求用户来自的页面 referer=request.servervariables("http_referer") '如果没有参考那就插入一个 if referer = "" then referer = "1.asp" end if %> <frameSET cols="225,*" framespacing="0" border="0" frameborder="0"> <frame NAME="left" SRC="navigation.asp" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING = "auto"> <frame NAME="right" SRC="<%= referer %>" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING = "auto"> </frameSET> navigation.asp <head> <title>Navigation Page</title> </head> <body bgcolor="#C0C0C0"> <div align="left"> <table border="0" cellpadding="0" cellspacing="0" width="200"> <tr> <td>This is a sample navigation page.&nbsp; Click on any on the links below to toggle back and forth between the frame and no frames view, while preserving the location your user came from <p>&nbsp;</p> <!-- be certain all links are targeted to the name of the frame from framepage.asp --> <p><a href="1.asp" target="right">Page 1</a></p> <p><a href="2.asp" target="right">Page 2</a></p> <p><a href="3.asp" target="right">Page 3</a></p> <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <p>&nbsp;</td> </tr> </table> </div> 1,2,3.asp This an example of a ordinary page <p>&nbsp;</p> <p><font size="6">1.asp</font></p> <p>&nbsp;</p> <p>Click <a href="1.asp"> here</a> for 1.asp<br> Click <a href="2.asp"> here</a> for 2.asp<br> Click <a href="3.asp"> here</a> for 3.asp<br> <br> </p> <!-- Insert this code into your current pages to "convert them to pages that can toggle between frames --> <p><a href="framepage.asp" target="_top">frame View</a><br> <a href="<%' insert the server variable script name. This '可以写出当前页面的名称 response.write request.servervariables("script_name") %>" target="_top">No frame View</a></p>

热门信息

X