当前位置:首页 > 网页特效 > 网站常用 >

添加JS代码禁止用户复制网页内容第二种方法

时间:2014-05-23 08:35 来源:互联网 作者:源码搜藏 收藏 推荐

运行代码 保存代码 复制代码 提示:您可以先修改部分代码再运行,保存代码功能在Firefox下无效。
  • 另一种禁止用户复制内容的方法,在网页的body标签中添加onmouseup=document.selection.empty() oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty()此行即可,不过用户若禁用JS或查看源代码的话,还是可以复制文件内容,因此本方法只可对付一些对电脑不太了解的访客。
  • <body onmouseup=document.selection.empty() oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty()>
    <table width="782" height="532" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="594" height="165">&nbsp;</td>
        <td width="188" height="165">&nbsp;</td>
      </tr>
      <tr>
        <td height="367" align="left" valign="top" style="text-indent:5px; font-size:12px">1
          、免费提交加盟申请;
            <p>2 、加盟申请通过公司审核后,加盟商会收到“ 金宝宝特许经营合同
              ”,并与公司签订合同 ;</p>
            <p>3 、加盟商缴纳保证金;</p>
            <p>4 、加盟商汇首批进货款,公司收到首批进货款后发货;</p>
            <p>5 、加盟商收货验货;</p>
            <p>6 、加盟店正式营业。</p>
            <p>&nbsp;</p></td><td height="367">&nbsp;</td>
      </tr>
    </table>
    </body>
由源码搜藏网整理,转载请注明出处https://www.codesocang.com/tx-wangzhan/8018.html

网站常用下载排行

最新文章