<!DOCTYPE html><html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=utf8"/> <script type="text/javascript"> function openWindow(){ var poker=confirm("you sure wanna open the website?"); if(poker=true) {dream();} else {document.write("good boy,you better sheep away!");} function dream(){ var heart=prompt("put in the website!"); if(heart!=null) {window.open("heart", "_black", "width=400, height=500, menubar=no, toolbar=no");} else {window.open("http://www.imooc.com/", "_black", "width=400, height=500, menubar=no, toolbar=no");} } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindow()" /> </body></html>
添加回答
举报
0/150
提交
取消