自己的答案僅供參考
function openWindow(){ ? ?var message=confirm("確定打開網站嗎?"); ? ?if(yn==true){ var mywin=prompt("請輸入網址:"); if(mywin="http://www.xianlaiwan.cn/") { ? ?window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,toolbar=no') } } else{} } openWindow();
2016-03-23
function openWindow(){ ?
??var message=confirm("確定打開網站嗎?"); ??
if(message==true) { ??
var url=prompt("請輸入一個網址","http://www.xianlaiwan.cn/");
?window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no')?
}
?}?
else
{window.close();}?
}?
2016-03-23
感覺你的程序有問題啊
2016-03-23
<!DOCTYPE HTML>
<html>
<head>
? ?<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
? ?<title>innerHTML</title>
? ?<script type="text/javascript">
? ? ? function openWindow()
? ? ? { ? ?var message=confirm("確定打開網站嗎?");
? ? ? ? ? if(message==true){
? ? ? ? ? ? ? ? ? window.open('http://www.xianlaiwan.cn/','_blank',
? ? ? ? ? ? ? ? ? ? ? ? ? 'width=400,height=500,menubar=no,toolbar=no')
? ? ? ? ? } else{
? ? ? ? ? ? ? ?//點擊取消執行將為空
? ? ? ? ? }
? ? ? }
? ? ? openWindow();
? ?</script>
</head>
<body>
</body>
</html>
2016-03-23
if(massage==true)
2016-03-23
yn是什么