我有一个旧网站,在左侧有一个框架式导航,右侧则是页面。
当页面直接输入URL时,导航(左侧框架)也应该显示。
Until now I was an js working, but I don t know from when it are not working, now returns this message:
Forbidden You don t have permission to access /master.html on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/2.2.10 (Unix) mod_ssl/2.2.10 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.cpis.es Port 80
我使用的代码是:
http://www.webmasterworld.com/forum21/1205.htm
Call this javascript code from the HEAD section of each child page. The code creates a variable from the URL of the page, and then passes that variable in the new location s URL. This means a "master" frameset can load this exact page in the content section:
<SCRIPT LANGUAGE="JavaScript">
passpage = document.URL
if (top.location == self.location)
top.location.href="master.html?" + passpage
</script>
Then create just one "master.html" page. It holds the JavaScript code to decipher whatever URL is passed after the "?" and it writes that page into the content frame:
<html>
<head>
<title>Master Frameset</title>
</head>
<script language="JavaScript" type="text/javascript">
origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexOf( ? )+1, origURL.length)
document.write( <frameset cols="20%,80%"><frame src="leftnav.html" name="nav"><frame src=" + contentURL + " name="content"></frameset> )
</script>
</html>
谢谢,Guillermo。