如何通过JavaScript代替超链接? 比如说,以前是这样的 <a href="buy.jsp">购买</a>现在我想通过一个按钮来实现这个功能,比如说<input bype="button" name="buy" value="购买">,想通过这个按钮跳到buy.jsp页面,该怎么办呢?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <input bype="button" name="buy" value="购买" onclick="javascript:document.location.href ="buy.jsp"">, 按钮添加点击事件,通过javascript 控制跳转<input bype="button" name="buy" onclick="toBuy();" value="购买">javascript 可以这样写:function toBuy(){ window.location.href = 'buy.jsp'; return;} <html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> </head> <script> function goto(){ window.location.href="login.jsp?...参数"; } </script> <body> <input type='button' value='gotoJsp' onclick='goto();'/> </body></html> struts2访问路径问题 急求大虾指点。struts1与jquery的整合问题 关于hibernate更新问题,急急急急急急! 源码分享:3秒搞定!~~ 一亿数据获取前1000个最大值 struts2标签总是附带有html HttpClient读验证码问题 struts+spring+hibernate中DAO类中如何自己写删除函数? jdk 1.5 与 jdk 1.42 严重问题!!!! 求助:一个RMI Naming绑定的问题。 发布工程时出现下面问题,求指点 新手的一个问题。。。 RESTClient测试出现错误Illeg
<input bype="button" name="buy" onclick="toBuy();" value="购买">javascript 可以这样写:
function toBuy(){
window.location.href = 'buy.jsp';
return;
}
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script>
function goto(){
window.location.href="login.jsp?...参数";
}
</script>
<body>
<input type='button' value='gotoJsp' onclick='goto();'/>
</body>
</html>