易截截图软件、单文件、免安装、纯绿色、仅160KB

Javascript 刷新框架及页面的方法总集

 先来看一个简单的例子:
下面以三个页面分别命名为frame.html、top.html、bottom.html为例来具体说明如何做。
frame.html 由上(top.html)下(bottom.html)两个页面组成,代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> frame </TITLE>
</HEAD>
<frameset rows="50%,50%">
<frame name=top src="top.html">
<frame name=bottom src="bottom.html">
</frameset>
</HTML>
现在假设top.html (即上面的页面) 有七个button来实现对bottom.html (即下面的页面) 的刷新,可以用以下七种语句,哪个好用自己看着办了。
语句1. window.parent.frames[1].location.reload();
语句2. window.parent.frames.bottom.location.reload();
语句3. window.parent.frames["bottom"].location.reload();
语句4. window.parent.frames.item(1).location.reload();
语句5. window.parent.frames.item('bottom').location.reload();
语句6. window.parent.bottom.location.reload();
语句7. window.parent['bottom'].location.reload();
top.html 页面的代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
  <TITLE> top.html </TITLE>
</HEAD>
<BODY>
<input type=button value="刷新1" onclick="window.parent.frames[1].location.reload()"><br>
<input type=button value="刷新2" onclick="window.parent.frames.bottom.location.reload()"><br>
<input type=button value="刷新3" onclick="window.parent.frames['bottom'].location.reload()"><br>
<input type=button value="刷新4" onclick="window.parent.frames.item(1).location.reload()"><br>
<input type=button value="刷新5" onclick="window.parent.frames.item('bottom').location.reload()"><br>
<input type=button value="刷新6" onclick="window.parent.bottom.location.reload()"><br>
<input type=button value="刷新7" onclick="window.parent['bottom'].location.reload()"><br>
</BODY>
</HTML>
下面是bottom.html页面源代


相关文档:

javascript的OO继承


在prototype框架中的类继承实现机制
//为Object类添加静态方法:extend
Object.extend = function(destination, source) {
  for(property in source) {
     destination[property] = source[property];
  }
  return destination;
}
//通过Object类为每个对象添加方法 ......

javascript 获取css 属性

 我们有时获取 styl.width为空的时候,可以获取css中的width..
但ie and ff 是不同的。。
ie:
obj.currentStyle['width'] 
ff:
var css = document.defaultView.getComputedStyle(obj, null);  
css.getPropertyValue('width')  ......

javascript 跳转 三种

<html>
<head>
<mce:script language="javascript"><!--

function old_page()
{
window.location = "http://www.jb51.net"
}
function replace()
{
window.location.replace("http://www.jb51.net")
}
function new_page()
{
window.op ......

怎样对.net中的javascript脚本进行调试?

第一步:在IE的“Internet设置”中选择“高级”——“安全”——“启用集成windows身份验证”。
第二步:在需要调试的页面的脚本中加上debugger; 然后运行这个页面,就会在这里停下来
例如:
function BtnSubmit_Click()
{
var aaa;
aaa='aaa';
debugg ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号