<!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("是否打開(kāi)新網(wǎng)頁(yè)");;
????????if(mymessage==true)
????????{
????????????var?url=prompt("請(qǐng)輸入網(wǎng)址","http://idcbgp.cn/");
???????????
????????????????window.open(url,'_blank','width=400,height=500';
????????}
????}
????
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開(kāi)網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>這里的prompt里我輸入www.daidu.com為什么窗打開(kāi)的還是慕課網(wǎng),輸入http://www.baidu.com就可以打開(kāi)百度為什么?(這是輸入www.baidu.com和www。imooc。com的結(jié)果) (輸入123是這個(gè)結(jié)果)這是為什么。。。。。
prompt獲取文本框內(nèi)容及window.open的url參數(shù)問(wèn)題
認(rèn)手為妻
2016-03-23 16:42:57