smida
2015-06-25 09:55
<!DOCTYPE html> <html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function openWindow(){ var yourconfirm = confirm("是否打开"); if(yourconfirm==true){ var yourprompt = prompt("你的网址", 'http://www.imooc.com/') if (yourprompt != null){ window.open(yourprompt,"blank","width=400,height=500,menubar=no,toolbar=no")} else{}} else{} } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindow()" /> </body> </html>
http后面的冒号用英文输入
thank u
JavaScript入门篇
739817 学习 · 9566 问题
相似问题