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

js使用(转)
转载是怕博主删掉后资源没了,也为了自己以后查阅方便,转载地址http://www.cnblogs.com/zengwei/archive/2009/07/13/1522354.html
转的代码没有一一测试,用到的时候再详细测试

行距,字体 style="line-height:150%;font-size:15pt"

脚本说明:   
把如下代码加入<body>区域中:   
  后退 前进   
<input type="button" value="后退" onClick="history.go(-1)">    
<input type="button" value="前进" onClick="history.go( 1 );return true;">    

  返回   
<form><input type="button" value="返回上一步" onClick="history.back(-1)"></form>  
 
  查看源码 
<input type="button" name="view" value="查看源码" 
onClick="window.location="view-source:" +window.location.href">    
  
  禁止查看源码   
<body oncontextmenu="return false"></body>    
  
  刷新按钮一   
<input type="button" value="刷新按钮一" onClick="ReloadButton()">    
<script>
    function ReloadButton(){
       location.href="i001.htm";
    }
</script>    
  
  刷新按钮二   
<input type="button" value="刷新按钮二" onClick="history.go(0)">    
  
  回首页按钮   
<input type="button" value="首页" onClick="HomeButton()">    
<script>
    function HomeButton(){
       location.href=http://www.winliuxq.com;
     }
</script>    
  
  弹出警告框   
<input type="button" value="弹出警告框" onClick="AlertButton()">    
<script>
    function AlertButton(){
       window.alert("要多多光临呀!");
    }
</script>    
  
  状态栏信息   
<input type="button" value="状态栏信息" onClick="StatusButton()">    
<script>
    function StatusButton(){
        window.status="要多多光临呀!";
    }
</script>    
  
  背景色变换   
<form><input type="button" value="背景色变换" onClick="BgButton()"></form>    
<script>
    function BgButton(){    
       if(document.bgColor=='#00ffff'){
           document.bgColor='#ffffff';
       }else{
           document.bgColor='#00ffff';
       }    
    }    
</script>    
  
  打开新窗口   
<input type="button" value="打开新窗口" onClick="NewWindow()">    
<script>
    function NewWindow(){
        window.open("c01.htm","","height=240,width=340,status=no,location=no,toolbar=no,directories=no,menubar=no");
      }    
</script>    
  
  窗口最小化   
<OBJECT id="min" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><PARAM name="Command" value="Minimize"></OBJECT>
<button onClick="min.Click()">窗口最小化</button>    
  
  全屏代码   
<input type="BUTTON" name="FullScreen" value="全屏显示" onClick="window.open(document.location, 'butong_net', 'fullscreen')">    
  
  关闭窗口   
<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><param name="Command" value="Close"></object><input type="button" value="关闭窗口" onClick="closes.Click();">    
  
  关闭窗口   
<input type=button va