链接防止重复点击
<html>
<script type="text/javascript">
let ctrl= false;
function btClick(a,url){
document.getElementById('bt1').disabled=true;
document.getElementById('bd').src=url;
window.setTimeout(
function () {
document.getElementById('bt1').disabled=false;
},1000);
}
function btClick2(a,url){
document.getElementById('bt1').disabled=true;
if(ctrl){
window.open(url);
}
else{
document.getElementById('bd').src=url;
}
window.setTimeout(
function () {
document.getElementById('bt1').disabled=false;
},1000);
}
function drag (url){
window.open(url);
}
</script>
<body>
<a id="a1" href="#" onclick="event.preventDefault();bt1.click()" ondragend ="drag('http://www.baidu.com')">双击、单击、拖拽看看</a>
<a id="a1" href="#" onclick="event.preventDefault();ctrl=event.ctrlKey;bt1.click()" >按住Ctrl点击看看</a>
<input type="button" id="bt1" onclick="btClick2(2,'http://www.baidu.com')" style="display:none"/>
<div>
<iframe id="bd" name="bd" src="" style="width:900px;height:600px" >
</iframe>
</div>
</body>
</html>