按钮代替链接 跳转前提示问题 我希望用按钮代替链接,在链接前弹出提示。是否真的要跳转。<input onClick="location.href='return confirm('真的要跳转吗?')"; material_out_pdf.php?out_id=1'; " type="button" value="重印">但按提示中的是后。跳转无效.请问如何解决呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 a连接也可以控制的<a id="a" href="http://www.csdn.net/" target="_blank">csdn</a>document.getElementById("a").onclick = function() { return confirm("是否跳转");};input的话<input onClick="if(confirm('真的要跳转吗?')){location.href='http://www.csdn.net/'}"; material_out_pdf.php?out_id=1'; " type="button" value="重印"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>test.html</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script> function go(){ var res = confirm('是否跳转'); if(res){ window.location.href='http://www.baidu.com' }else{ //..什么都不做 } } </script> </head> <body> <a href="#" onclick="go()">go</a> </body></html> 关于JS限制输入数字 JQ 问题,弹窗问题 关于google自定义搜索的搜索样式问题 歌曲连播 急急急!! 不用 javascript 函数库,实现加法!! javascript如何比较中文字符串? 如何通过即时通信服务器返回信息在页面上判断用户在不在线(类似于阿里巴巴的贸易通状态) 怎么控制一个text框只能输入数字啊 哪位大侠能帮帮小弟看看下面的代码错在哪里啊? 一个网页的脚本变量,怎样被另一个网页的脚本调用? 图片部分区域触发如何实现 关于highchart【续】
<a id="a" href="http://www.csdn.net/" target="_blank">csdn</a>
document.getElementById("a").onclick = function() {
return confirm("是否跳转");
};
input的话
<input onClick="if(confirm('真的要跳转吗?')){location.href='http://www.csdn.net/'}"; material_out_pdf.php?out_id=1'; " type="button" value="重印">
<html>
<head>
<title>test.html</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script>
function go(){
var res = confirm('是否跳转');
if(res){
window.location.href='http://www.baidu.com'
}else{
//..什么都不做
}
}
</script>
</head>
<body>
<a href="#" onclick="go()">go</a>
</body>
</html>