为按钮绑定实现js跳转


页面代码

<button type="button" class="btn btn-xs btn-info" id="add" name="add" onclick="addNewProduct()"><i class="fa fa-plus"></i> 新增</button>

js代码

<script type="text/javascript">
  	// 添加商品
  	function addNewProduct(){
  		window.location.href = "${pageContext.request.contextPath }/product?method=addNewProduct";
  	}
</script>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM