課程
/前端開(kāi)發(fā)
/JavaScript
/JavaScript入門篇
有例子可以參考嗎
2016-06-14
源自:JavaScript入門篇 2-7
正在回答
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ??
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? ? ? function openWindow(){
? ? ? ??
? ? ? ? var opens = confirm("是否打開(kāi)新窗口?");
? ? ? ? if(opens==true){
? ? ? ? ? ? window.open('http://idcbgp.cn/','_blank','width=400,height=500,menubar=no,toolbar=no,status=no,scrollbars=no');
? ? ? ? }
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
<!doctype html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript"> ?
? ? function openwindow()
? ? {
? ? ? ?var temp=confirm("您是否要打開(kāi)一個(gè)網(wǎng)站?");
? ? ? ? if(temp==true)
? ? ? ? {
? ? ? ? ? ? // alert("yes");
? ? ? ? ? ? var url=prompt("input ?website:");
? ? ? ? ? ? window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? else
? ? ? ? ? alert("您不想打開(kāi)一個(gè)網(wǎng)站,88");
? ? ? ? }?
? </script> ?
</head>
<body>
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openwindow()" />?
</body>
舉報(bào)
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
2 回答學(xué)習(xí)這一節(jié),還有前面一節(jié)有什么用
4 回答怎么不是視頻啊,初學(xué)的我無(wú)從下手
5 回答敢問(wèn) 編程在哪里練習(xí)?怎么練習(xí)? ?
3 回答為何之前都還可以實(shí)現(xiàn)前面的操作,編輯到最后一個(gè)按鈕的時(shí)候就全都無(wú)法改變樣式了?
1 回答怎么用java script實(shí)現(xiàn)文字從左到右一次改變顏色 請(qǐng)大家?guī)蛶臀疫@個(gè)新手 幫忙解決一下吧!
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-06-14
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ??
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ??
? ? ? ? function openWindow(){
? ? ? ??
? ? ? ? var opens = confirm("是否打開(kāi)新窗口?");
? ? ? ??
? ? ? ? if(opens==true){
? ? ? ? ? ? window.open('http://idcbgp.cn/','_blank','width=400,height=500,menubar=no,toolbar=no,status=no,scrollbars=no');
? ? ? ? }
? ? ? ??
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-06-14
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript"> ?
? ? function openwindow()
? ? {
? ? ? ?var temp=confirm("您是否要打開(kāi)一個(gè)網(wǎng)站?");
? ? ? ? if(temp==true)
? ? ? ? {
? ? ? ? ? ? // alert("yes");
? ? ? ? ? ? var url=prompt("input ?website:");
? ? ? ? ? ? window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? alert("您不想打開(kāi)一個(gè)網(wǎng)站,88");
? ? ? ? }?
? </script> ?
</head>
<body>
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openwindow()" />?
</body>
</html>