简体   繁体   English

如何在iframe中的另一个页面中重新加载页面

[英]how to reload a page in another in an iframe

I have made 3 websites 我做了3个网站

http://ice-os.com
http://hannahmontana.sf.net
http://demilovato.sf.net

they use an iframe on the main page index.html and load all the pages in this iframe what i want to do is if some goes to say http://en.ice-os.com/home.html instead of index.html I want to reload this home.html in my index.html in the iframe how can this be done? 他们在首页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;">&nbsp;</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>

Wow, it's been a while, but I've seen this done with Javascripts that force users into framesets. 哇,已经有一段时间了,但是我已经看到了使用Java强制用户进入框架集的方法。 I remember it from back in the late 90s, but I think it's kind of fallen out of favor since users have generally hated frames. 我记得它是从90年代后期开始的,但是我认为它有点失宠,因为用户通常讨厌框架。 (Usually this was for navigation on sites that, for whatever reason at the time, either didn't support server-side includes or perhaps the developer didn't understand includes...) (通常,这是为了在网站上进行导航,无论当时出于何种原因,这些网站要么不支持服务器端包含,要么开发人员可能不理解包含...)

You can probably Google "javascript open page in frameset" and find a sample. 您可能可以使用Google“框架集中的javascript打开页面”并找到示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM