我已经制作了3个网站
http://ice-os.com
http://hannahmontana.sf.net
http://demilovato.sf.net
他们在主页index.html上使用iframe并加载此iframe中的所有页面 我想要做的是,如果有人说http://en.ice-os.com/home.html而不是index.html我想 在iframe的index.html中重新加载此home.html 怎么办呢?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
body{padding:0;margin:0;}
.myFloatBar{
top:0;
left:0;
width:50px;
position:fixed;
}
<style>
<style type="text/css">
html {overflow: auto;}
html, body, div, iframe {margin: 0px; padding: 0px; height: 100%; border: none;}
iframe {display: block; width: 100%; border: none; overflow-y: auto; overflow-x: hidden;}
</style></head><body style="background-color: rgb(35, 35, 35); color: rgb(0, 0, 0);" alink="#ee0000" link="#0000ee" vlink="#551a8b">
<div style="margin-left: 50px; font-family: monospace;"><iframe id="tree" name="tree" src="home.html" marginheight="0" marginwidth="0" frameborder="0" height="100%" scrolling="auto" width="100%"></iframe></div>
<div class="myFloatBar"><span style="font-family: monospace;"> </span><span style="color: rgb(233, 233, 233); font-family: monospace;">氷Bar</span><img src="http://ice-os.com/images/home.png" alt="Home" title="Home" onclick="document.getElementById('tree').src='home.html';document.title='Home'" style="width: 48px; height: 48px;"><img onclick="document.getElementById('tree').src='downloads.html';document.title='Downloads'" style="width: 48px; height: 48px;" alt="Downloads" title="Downloads" src="http://ice-os.com/images/downloads.png"><img onclick="document.getElementById('tree').src='links.html';document.title='Links'" style="width: 48px; height: 48px;" alt="Links" title="Links" src="http://ice-os.com/images/links.png"><img style="width: 48px; height: 48px;" onclick="document.getElementById('tree').src='projects.html';document.title='Projects'" alt="Projects" title="Projects" src="http://ice-os.com/images/projects.png"><img style="width: 48px; height: 48px;" alt="Revision Control" title="Revision Control" src="http://ice-os.com/images/revisioncontrol.png"><img style="width: 48px; height: 48px;" onclick="document.getElementById('tree').src='contact.html';document.title='Contact'" alt="Contact" title="Contact" src="http://ice-os.com/images/contact.png"><img onclick="document.getElementById('tree').src='about.html';document.title='About'" style="width: 48px; height: 48px;" alt="About" title="About" src="http://ice-os.com/images/about.png"></div>
</body></html>
答案 0 :(得分:2)
对于学术界人士。在stackoverflow上搜索frame buster buster buster
答案 1 :(得分:1)
你可能可以谷歌&#34; javascript打开页面框架中的页面&#34;并找到一个样本。