課程
/前端開發
/JavaScript
/JavaScript入門篇
來個準確的大神吧
2017-06-21
源自:JavaScript入門篇 2-7
正在回答
"window.open(url." ? ?這個url啥用啊
<!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 open=confirm("確認新建窗口打開網站嗎?");
? ? ? ? ? ? if(open==true)
? ? ? ? ? ? ? ? {var url=prompt("通過輸入對話框,確定打開的網址","http://www.xianlaiwan.cn");
? ? ? ? ? ? ? ? ? ? if(url!==null){
? ? ? ? ? ? ? ? ? ? ? ? window.open(url,"_blank",'width=400px,height=500px,menubar=no,toolbar=no');
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ?else{
? ? ? ? ? ? ? ? ? ? ? ? ?alert("再見2");
? ? ? ? ? ? } ??
? ? ? ? ? ?else{
? ? ? ? ? ? ? ?alert("再見1");
? ? ? ? ? ? }
? ? ?}
?</script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
舉報
JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門
4 回答不知道怎么寫了。。。
2 回答完整的代碼
1 回答這個代碼完整是怎么樣的?
11 回答不知道哪里代碼錯了
1 回答代碼不知道哪里錯了?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-07-04
"window.open(url." ? ?這個url啥用啊
2017-06-21
<!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 open=confirm("確認新建窗口打開網站嗎?");
? ? ? ? ? ? if(open==true)
? ? ? ? ? ? ? ? {var url=prompt("通過輸入對話框,確定打開的網址","http://www.xianlaiwan.cn");
? ? ? ? ? ? ? ? ? ? if(url!==null){
? ? ? ? ? ? ? ? ? ? ? ? window.open(url,"_blank",'width=400px,height=500px,menubar=no,toolbar=no');
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ?else{
? ? ? ? ? ? ? ? ? ? ? ? ?alert("再見2");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? } ??
? ? ? ? ? ?else{
? ? ? ? ? ? ? ?alert("再見1");
? ? ? ? ? ? }
? ? ?}
?</script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>