再见不见sid
2018-05-30 16:25
<!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 myMessage=comfirm("是否打开"); if(myMessage == true){ var mywebsite = prompt("输入网址","http://www.imooc.com/"); if(mywebsite!=null){ window.open(mywebsite,'_blank','width=400,height=500,menubar=0,toolbar=0'); } } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindow()" /> </body> </html>
comfirm -> confirm
JavaScript入门篇
739817 学习 · 9566 问题
相似问题