当前位置:K88软件开发文章中心编程全书编程全书01 → 文章内容

网页刷新方法集锦

减小字体 增大字体 作者:佚名  来源:翔宇亭IT乐园  发布时间:2019-1-3 0:28:48

:2010-04-19 09:16:00

我们在制作网页过程中,经常需要刷新网页来更新网页的内容,那么如何实现网页刷新呢?下面就给出网页刷新的相关代码,供大家参考:

(1)<input type=“button” value=“刷新当前页" onclick="history.go(0);">

(2)<input type="button" value=”刷新当前页" onclick="location=location;">

(3)<input type="button" value="刷新当前页" onclick="location.reload();">

(4)<input type="button"  value="刷新当前页" onclick="location.replace(location);">

(5)<input type="button" value="刷新当前页" onclick="window.navigate(location);">

(6)<input type=“button"  value="刷新当前页" onclick="document.execCommand(@#Refresh@#)">

(7)<input type=”button" value="刷新当前页" onClick="document.all.WebBrowser.ExecWB(22,1)">

(8)<input type="button" value="刷新当前页" onclick="window.open(@#自身的文件@#,@#_self@#)">

前5种网页刷新方法,大家都比较熟悉,而后三种网页刷新方法可能大家比较陌生,实际上后三种需在IE5.5以上的浏览器中支持。具体参加本网站的文章:

(1)document.execCommand()方法介绍

(2)document.all.WebBrowser.ExecWB()方法介绍



网页刷新方法集锦