当前位置: 代码迷 >> Java Web开发 >> click事件,该怎么处理
  详细解决方案

click事件,该怎么处理

热度:97   发布时间:2016-04-12 23:20:21.0
click事件
我写了一个div,名字是buybutton,属性是:
.buybutton{ width: 89px;
height: 24px;
background: url(${ initParam.resource }/image/button1.png);
background-position: bottom;
float: right;
margin-top: 15px;
margin-right: 10px;}
.buybutton:hover{ background-position:center}
.buybutton:active{ background-position:top}
,现在我想点击这个div后跳转运行
${ pageContext.request.contextPath }/customer!querystore.action?tp_id=${stores.tp_id}
这个,那我在javascript里该怎么写这个click事件,求帮忙

------解决方案--------------------

$(".buybutton").click(function(){
window.location.href = '${ pageContext.request.contextPath }/customer!querystore.action?tp_id=${stores.tp_id}';

})

这样?
  相关解决方案