課程
/前端開發
/JavaScript
/JavaScript入門篇
<!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 open=prompt("通過輸入對話框,確定打開的網址","http://www.xianlaiwan.cn/"); ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ? ?if(url!=null) ? ? ? ? ? ? ? ? ?{ ? ? ? ? ? ? ? ? ? ? ?window.open('url','_blank','width=400px,height=500px,menubar=no,toolbar=no'); ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ?else ? ? ? ? ? ? ? ? ?{ ? ? ? ? ? ? ? ? ? ? alert("結束1"); ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ? ?else{ ? ? ? ? ?alert("結束2"); ? ? ? ? } ? ? } ? ? ? ? ? ? ? ? </script> ? </head> ? <body> ? ? ? ?<input type="button" value="新窗口打開網站" onclick="openWindow()" /> ? </body> </html>
2017-01-07
源自:JavaScript入門篇 2-7
正在回答
var url=promp("通過輸入對話框,確定打開的網址","http://www.xianlaiwan.cn");
qq_小涂_1 提問者
舉報
JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門
5 回答<html> <head> <title> ll</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function openwindow(){var open=confirm("確定打開這個
4 回答<!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 aa; aa=prompt('確定打開嗎');
1 回答<!DOCTYPE html> <html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function rec(){ var message=cofirm("是否打開窗口?"); if(message
2 回答<!DOCTYPE html> <html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> // 新窗口打開時彈出確認框,是否打開 // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
3 回答<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>display</title> <script type="text/javascript"> var i=0; function hidetext(){ i++; if(i%2!=0){
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-01-08
var url=promp("通過輸入對話框,確定打開的網址","http://www.xianlaiwan.cn");