<!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=confirm("是否打开新网页");; if(mymessage==true) { var url=prompt("请输入网址","http://www.imooc.com/"); window.open(url,'_blank','width=400,height=500'; } } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindow()" /> </body> </html>
这里的prompt里我输入www.daidu.com为什么窗打开的还是慕课网,输入http://www.baidu.com就可以打开百度为什么?
(输入123是这个结果)
这是为什么。。。。。
相关分类