我想在网页中加入一段"进入备案中心"
就是<a href="http://www.bj.cyberpolice.cn" class="white">进入备案中心</a>然后就是这段代码,愿意是电击右键进入备案中心,我想在“进入备案中心”点击右键后进入,不知如何写。谢谢大家!
<script language="javascript">
if (navigator.appName.indexOf("Internet Explorer") != -1) 
document.onmousedown = noSourceExplorer;
function noSourceExplorer()
{
if (event.button == 2 | event.button == 3)
{
   alert("进入备案中心!");
   location.replace("http://www.bj.cyberpolice.cn");
}
}
</script>

解决方案 »

  1.   

    <a oncontextmenu="location.href='http://www.bj.cyberpolice.cn';return false;" href="#" class="white">进入备案中心</a>
      

  2.   

    谢谢兄弟,假如我需要左单击超链接(进入备案中心)是进入www.110.com右单击进入www.120.com怎么做?
      

  3.   

    <script language="javascript">
    window.onload = function (){
        var link  = document.getElementById("backUpCenter");
        if (navigator.appName.indexOf("Internet Explorer") != -1) 
        {
            link.attachEvent("oncontextmenu", function () {
                 alert("进入备案中心!"); 
                 location.href='http://www.120.com';
                 return false;
                 }); 
        }
    }
    </script>
    <a href="http://www.110.com" class="white" id="backUpCenter">进入备案中心</a>
      

  4.   

    <a oncontextmenu="location.href='http://www.120.com';return false;" 
    href="http://www.110.com" class="white">进入备案中心</a>