如何用js的confirm做判断

<a href="javascript:if(confirm('确实要删除吗?'))location='andy.php?'">删除</a>

如果是按钮
<input type=button onclick="javascript:if(confirm('确实要删除吗?'))location='andy.php?'" value="删除">
//获取字符长度
function getBytesLength(str) {   // 在GBK编码里,除了ASCII字符,其它都占两个字符宽   return str.replace(/[^\x00-\xff]/g, 'xx').length; }
原文地址:https://www.cnblogs.com/ybbqg/p/2405504.html