问答详情
源自:2-7 编程练习

2-7练习

<!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 a = confirm("确定打开新窗口?");//新窗口打开时弹出确认框,是否打开        if(a==true){             var youurl = prompt("请输入需要打开的网址!","http://");            if(youurl!=null){                //通过输入对话框,打开输入的网址                window.open( youurl ,'_blank','width=400,height=500,menubar=yes,toolbar=yes');            }            else{                //如果不输入则默认打开http://www.imooc.com/                window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=yes,toolbar=yes');            }        }        else{            document.write("打开失败!");        }    };  </script>  </head>  <body> 	  <input type="button" value="新窗口打开网站" onclick="openWindow()" />  </body></html>


提问者:慕哥4089420 2018-08-22 16:24

个回答

  • 天天向上学
    2018-08-22 17:46:14

    https://img4.mukewang.com/5b7d30db00010e9500480048.jpg???