<a href="#">连接一</a><script language=Javascript><!--
var txt;
function document.onmouseover(){
  txt = window.event.toElement.innerText; 
  //可以得到鼠标现在所处位置的文字
  }
function document.onmousedown(){
  if(event.button==1 && txt=="连接一") //左击
     window.location.href="aa.asp";
  if(event.button==2 && txt=="连接一") //右击
     window.location.href="bb.asp";
  //且这两个判断都是当鼠标在"连接一"文字上时发生的
  }
// --></SCRIPT>

解决方案 »

  1.   

    楼上兄弟,顺便问怎么调用JavaScript:selectUrl('001','002')这个函数里参数呀?能否用这个参数来决定是哪个连接对象?
      

  2.   

    可以呀!不过实现起来比较麻烦:
    <a href="#">连接一</a><br>
    <a href="#">连接二</a><script language=Javascript><!--
    var txt,topid,childid;
    function document.onmouseover(){
      txt = window.event.toElement.innerText; 
      //可以得到鼠标现在所处位置的文字
      }
    function document.onmousedown(){
      if(event.button==1 && cc()){ //左击
        window.location.href="aa.asp?topid="+topid+"&id="+childid;
        }
      if(event.button==2 && cc()){ //右击
        window.location.href="bb.asp?topid="+topid+"&id="+childid;
        }
      }
    function cc(){  //此函数是专门为每个链接赋新参数的。
      switch (txt){
        case "连接一" :
           topid   = "1";
           childid = "2";
           break;
        case "连接二" :
           topid   = "3";
           childid = "4";
           break;
        default :
           return false;
        }
      return true;
      }
    // --></SCRIPT>
      

  3.   

    谢谢meizz(梅花雨) 兄弟,等一会给你分,不过我对js很不熟,我再问你一个笨问题,如果上面连接的名字不知道,怎么办,我想用括号的参数来决定连接。