为页面上所有链接规定默认目标:
<head> <base target="_blank" /> </head> <body> <a href="http://www.w3school.com.cn">W3School</a> </body>
按钮删除前提示,确认后执行操作
<input name="button" type="button" onclick="javascript:if(confirm('确认删除?'))document.location.href='show.php?id=123'" value="删除" />
操作成功并转向
echo "<script>alert('场次成功!');location.href='?".$back_url."';</script>"; exit;
错误提示并后退
echo "<script language=javascript>alert('不能为空!');javascript:history.back(-1);</script>"; exit;