给button加超链接 window.open与window.location.href区别

😂 这篇文章最后更新于2014天前,您需要注意相关的内容是否还可用。

加超链接很简单,只需要在标签里添加点击事件:

onclick="window.open('/admin/goods_edit.html')"
或者
onclick="window.location.href='/admin/goods_edit.html'"

再抑或在外部加个a标签即可。

window.open只是打开页面
window.location.href打开页面并刷新