<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無標題文檔</title> <script language="javascript" type="text/javascript" > function chens(a,b,c,d) { this.a=a==null?alert("a"):"chen"; b==null?alert("b"):""; c==null?alert("c"):""; document.write(this.a); this.d==null?alert("d"):""; } </script> </head> <body> <input type="button" id="btnan" value="dkdk"/> <input type="button" onclick="location.replace('http://www.jb51.net');" value="dkskk"/> <script> var newopen = function(i) { return function() { location.replace("http://www.jb51.net"); } } if (document.getElementById("btnan").attachEvent) { document.getElementById("btnan").attachEvent("onclick",newopen("popo")); } else { document.getElementById("btnan").addEventListener("click",newopen("tyty"),false); } </script> </body> </html>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]