小编use*_*766的帖子

使用javascript在所有浏览器中禁用"保存并另存为"选项

我想在所有浏览器中禁用"另存为"和"保存"选项(如Internet Explorer,Chrome,Firefox,Opera等).我已经禁用右键单击我的网页.代码在这里:

    var message="Function Disabled!"; 
     function clickIE4()
       if(event.button==2){
          alert(message);
          return false; 
       }
    } 
    function clickNS4(e){
      if(document.layers||document.getElementById&&!document.all){
        if (e.which==2||e.which==3){  
          alert(message);
          return false; 
        } 
     } 
   } 
   if (document.layers){  
     document.captureEvents(Event.MOUSEDOWN);
     document.onmousedown=clickNS4;
   } 
   else if(document.all&&!document.getElementById){
       document.onmousedown=clickIE4; 
   }  
   document.oncontextmenu=new Function("alert(message);return false")
Run Code Online (Sandbox Code Playgroud)

javascript

-1
推荐指数
1
解决办法
1万
查看次数

标签 统计

javascript ×1