<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>
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>
<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>