<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>打开新页面</title> <script type="text/javascript"> window.onload=function(){ var e=e||event; var openNewPage=function(e){ e.onclick=function(){ window.location.href=this.getAttribute('data_href'); /* window.open('目标页面'); window.history.back(-1); window.location.replace('目标页面'); */ } } openNewPage(document.getElementById("openNewPage")); }; </script> </head> <body> <input type="button" data_href='http://www.baidu.com' id='openNewPage' value="dakai"/> </body> </html>
断了一段时间的wifi,全拿去研究基础的控制代码了。。。。。