window.location.href无效的原因之一 解决方法: 给botton添加type="button"属性即可:http://www.yayihouse.com/yayishuwu/chapter/1916