admin 发表于 2023-12-26 15:56

常用的js代码

常用的js代码
    var domain=document.domain
    if (domain!='www.jinhei.com'&&domain!='m.jinhei.com'&&domain!='jinhei.com'){
      location.href='https://www.jinhei.com'
    }
    document.addEventListener('copy',(e)=>{
      e.preventDefault();//禁用复制
      // console.log(e.target);复制的是哪个标签段落
      e.clipboardData.setData('text/plain','禁止复制');
    })
    //开启后禁用F12
    document.onkeydown=function(){var e=window.event||arguments;if(e.keyCode==123){return false;}else if((e.ctrlKey)&&(e.shiftKey)&&(e.keyCode==73)){return false;}};document.oncontextmenu=function(){return false;}
页: [1]
查看完整版本: 常用的js代码