<a href="http://www.google.com" name=a1 id=a1 hit=0 onclick="this.hit++;return this.hit==1">链接1</a>
<a href="http://www.google.com" name=a2 id=a2>链接2</a>
<a href="http://www.google.com" name=a3 id=a3>链接3</a>
<a href="http://www.google.com" name=a2 id=a2>链接2</a>
<a href="http://www.google.com" name=a3 id=a3>链接3</a>
<a href="http://www.google.com" name=a2 id=a2 onclick="window.open(this.href);this.outerHTML=this.innerHTML;return false">链接2</a>
<a href="http://www.google.com" name=a3 id=a3 onclick="this.href=''" target="_blank">链接3</a>
<a href="http://www.google.com" name=a1 id=a1 target="_blank">链接1</a>
<a href="http://www.google.com" name=a2 id=a2 target="_blank">链接2</a>
<a href="http://www.google.com" name=a3 id=a3 target="_blank">链接3</a><SCRIPT LANGUAGE="JavaScript">
document.onclick = function(e)
{
e = e || window.event;
e = e.target || e.srcElement;
if(e.tagName=="A") e.disabled = true;
}
</SCRIPT>
我可能没表达清楚,我希望是禁止连续点击某个链接,而不是只能点击一次,这样有可能实现吗?
<a href="http://www.google.com" name=a1 id=a1 onclick="if(disabled)return false;disabled=true;a2.disabled=a3.disabled=false;" target="_blank">链接1</a>
<a href="http://www.google.com" name=a2 id=a2 onclick="if(disabled)return false;disabled=true;a1.disabled=a3.disabled=false" target="_blank">链接2</a>
<a href="http://www.google.com" name=a3 id=a3 onclick="if(disabled)return false;disabled=true;a1.disabled=a2.disabled=false" target="_blank">链接3</a>不过你要的可能仅仅是<a href="http://www.google.com" name=a1 id=a1 target="a1">链接1</a>
<a href="http://www.google.com" name=a2 id=a2 target="a2">链接2</a>
<a href="http://www.google.com" name=a3 id=a3 target="a3">链接3</a>
<a href="http://www.google.com" name=a2 id=a2 target="_blank">链接2</a>
<a href="http://www.google.com" name=a3 id=a3 target="_blank">链接3</a>
<SCRIPT LANGUAGE="JavaScript">
<!--
for (var i=0;i<document.anchors.length;i++)
document.anchors[i].attachEvent("onclick",
function(){
if (window.lastClick==event.srcElement) return false;
window.lastClick=event.srcElement;
}
)
//-->
</SCRIPT>