• 禁止别人复制的代码 - [blogbus代码]

    2008-10-23               

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://hi555.blogbus.com/logs/30536088.html

           前不久有一网友给我留言,问我有防止别人转载他的文章的代码,我就自己给他编了一个。我想大家今后也用的着,所以,干脆我就把它公布出来吧!

    <noscript>
    <iframe scr="*.htm"></iframe>
    </noscript>
    <script language="JavaScript">
    <!--
    function key(){
    if(event.shiftKey){
    window.close();}
    //禁止shift
    if(event.altKey){
    window.close();}
    //禁止alt
    if(event.ctrlKey){
    window.close();}
    //禁止ctrl
    return false;}
    document.onkeydown=key;
    if (window.Event)
    document.captureEvents(Event.MOUSEUP);
    //swordmaple javascript article.
    function nocontextmenu(){
    event.cancelBubble = true
    event.returnValue = false;
    return false;}
    function norightclick(e){
    if (window.Event){
    if (e.which == 2 || e.which == 3)
    return false;}
    else
    if (event.button == 2 || event.button == 3){
    event.cancelBubble = true
    event.returnValue = false;
    return false;}
    }
    //禁止右键
    document.oncontextmenu = nocontextmenu; // for IE5+
    document.onmousedown = norightclick; // for all others
    //-->
    </script>
    <body ; ;>
    <noscript>
    <iframe scr="*.htm" id="t"></iframe>
    </noscript>

         运行方式,只有有人在该网页中按shift,alt或ctrl,该网页都会自动关掉,右键也屏蔽掉了。当然,如果,大家对该运行方式不满意,不想该网页关掉的话,只要将上面带红色的close改成open。
      





    想与sandy一起学习博客赚钱知识吗?不要忘了订阅我哦!
    添加到网摘:

    文章信息:

    评论

  • 不会用[defFace:4]
    回复古怪说:
    有什么不懂的,您可以提出来啊!
    是哪里没弄明白啊!
    2009-12-01 21:45:03
  • 很好。。应该多加强这些维护版权的行为
    回复michael说:
    呵呵!
    谢谢您的支持,能留下您的主页地址吗?
    2009-04-18 15:27:47