javascript怎么通过按钮跳转跳转新页面

给按钮添加点击事件,然后用js跳转点击事件。
跳转的方式大概有以下几种:(跳转到b.html)[xss_clean]_window.location.href="b.html";[xss_clean]第二种:(返回上一页)[xss_clean]window.history.back(-1);[xss_clean]第三种类型:[xss_clean]window.navigate("b.html");[xss_clean]第四种类型:[xss_clean]self.location='b.html';[xss_clean]第五种:[xss_clean]top.location='b.html';[xss_clean]