关于jQuery双事件多重加载的问题。

<html>
<a href="1**.html">
	<button onclick="buttonEvent()">点击事件</button>
</a>
</html>


function buttonEvent(){
		location.href = "2**.html";
	}


如代码显示那样,当点击button按钮的时候想跳转到2**.html页面。可是,这个最终执行的结果是,先跳转到2**.html页面,而后再跳转到1**.html页面,最终显示的结果是1**.html页面中的内容。html


那么,在function中加入下面的代码才能够达到上面的目的。code


function buttonEvent(e){
		e = e || window.event;
		e.stopPropagation();
		e.preventDefault();
		location.href = "2**.html";
	}
相关文章
相关标签/搜索