第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么這段代碼沒有反應(yīng),有沒有大神來看看,新手

為什么這段代碼沒有反應(yīng),有沒有大神來看看,新手

<!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 rst=confirm('要打開一個新網(wǎng)址嗎?? ? ? ') ?;? ? ? if(rst==ture)? ? ? {? ? ? window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no');? ? ? }? ? }? ? ? ??? ? ? ??? ? ? ??? ? // 新窗口打開時彈出確認(rèn)框,是否打開? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。? ??? ??? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />??</body></html>
查看完整描述

2 回答

?
魂魄之子

TA貢獻(xiàn)5條經(jīng)驗(yàn) 獲得超0個贊

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title> new document </title> ?

<meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ?

<script type="text/javascript"> ?

function openWindow( url )

{

var rst = confirm( '確定打開這個鏈接嗎?');

console.log( rst )

if( rst ){

window.open( url );

}

}

</script>

</head>

<body>

<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow( 'http://idcbgp.cn' )" />

</body>

</html>


查看完整回答
反對 回復(fù) 2018-10-06
?
慕仔8853991

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個贊

<meta http-equiv="Content-Type" content="text/html; charset=gbk2312"/> <!--此處應(yīng)該為gbk2312,保證字體兼容,或者改為utf-8-->

var rst=confirm('要打開一個新網(wǎng)址嗎?');<!--此處格式換到一行中,你整個代碼的格式都挺亂,調(diào)整下格式,注意縮進(jìn)-->

if(rst==true)<!--此處true是一個布爾值可以直接使用,但你寫錯成了ture就會顯示未定義-->


查看完整回答
反對 回復(fù) 2018-10-06
  • 2 回答
  • 1 關(guān)注
  • 1394 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號