第一種方法:挺好用的,確認以后才能打開下載地址頁面。原理也比較清晰。主要用於刪除單條信息確認
function test(){ var msg = "請先登錄!"; if (confirm(msg)==true){ window.location.href='http://www.e1617.com/user.html'; return true; }else{ return false; } } <a class="join-btn " href="javascript:void(0);" onclick="test()" >創建聯盟</a>
第二種方法:原理跟上面的一樣。JavaScript刪除確認框
<a href="javascript:if(confirm('確實要刪除嗎?'))location='jb51.php?id='">刪除</a>