日期:2014-05-16  浏览次数:20349 次

73种网页常用js代码(转)

73种网页常用js代码(转)

?

?

1、后退 前进???
<input type="button" value="后退" onClick="history.go(-1)">???
<input type="button" value="前进" onClick="history.go( 1 );return true;">???
??
2、返回???
<form><input type="button" value="返回上一步" onClick="history.back(-1)"></form>???
??
3、查看源码???
<input type="button" name="view" value="查看源码" onClick="window.location="view-source:" +window.location.href">???
??
4、禁止查看源码???
<body oncontextmenu="return false"></body>???
??
5、刷新按钮一???
<input type="button" value="刷新按钮一" onClick="ReloadButton()">???
<script>function ReloadButton(){location.href="i001.htm";}</script>???
??
刷新按钮二???
<input type="button" value="刷新按钮二" onClick="history.go(0)">???
??
6、回首页按钮???