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

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么我的代碼沒有實現(xiàn)??

<!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 mymessage=confirm("是否在新窗口打開新的網(wǎng)站");

? ? if(mymessage==true)

? ? {

? ? ? ?document.write("是"); ? ?

? ? }

? ? else

? ? {

? ? ? ??

? ? ? ? document.write(“否”);

? ? }

? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/

? ? ?//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。

? ? var myname=prompt("請輸入你的網(wǎng)址");

? ? if(myname!=null)

? ? {

? ? ? window.open("http://idcbgp.cn/","width=400,height=500,toolbar=no,menubar=no");

? ? else

? ? {

? ? ? ? alert("關(guān)閉");

? ? }

? ? ? ??

? ? }

? ?

??

? } ??

? </script>?

?</head>?

?<body>?

?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?

?</body>

</html>


正在回答

4 回答

function wopen(){
var xw=confirm('是否新建窗口?');
if(xw==true){
var url=prompt('請輸入網(wǎng)址', 'http://idcbgp.cn');
if(url){
window.open(url,'_blank','width=400,height=400;left=100,top=200');
}else{
document.write('你沒有打開新窗口');
}
}else{
document.write('你沒有打開新窗口');
? ? ? ? //wopen();
}
}

0 回復 有任何疑惑可以回復我~

你的代碼里面有幾個小問題,我該了一下,而且function函數(shù)里面的confirm和prompt兩個屬性的聯(lián)系你也沒有體現(xiàn),我修改后感覺兩個還是獨立運行的,并不是通過confirm的 是 否 ?來確定是否運行prompt。你可以參考下。要是能修改好,回我一下,謝謝

<!DOCTYPE?html>
<html>
?<head>
??<title>?new?document?</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"/>???
??<script?type="text/javascript">??
??function?openWindow(){
????var?mymessage=confirm("是否在新窗口打開新的網(wǎng)站");
????if(mymessage==true)
????{
???????document.write("是");????
????}
????else
????{??
????????document.write("否");
????}
????var?myweb=prompt("請輸入你的網(wǎng)址");
????if(myweb!=null)
????{
??????window.open("http://idcbgp.cn/","width=400,height=500,toolbar=no,menubar=no");}
??????else
??????{
??????????alert("關(guān)閉");
??????}???
??}
??</script>?
?</head>?
???<body>?
?????<input?name="button"?type="button"?onclick="openWindow()"?value="新窗口打開網(wǎng)站"?/>?
???</body>
</html>


1 回復 有任何疑惑可以回復我~

第一個if語句中,要用confirm消息對話框。你用?document.write ?這個只能在網(wǎng)站頁面上顯示“是”“否”

0 回復 有任何疑惑可以回復我~

function openWindow(){
? ? ?var ope;
? ? ?// 新窗口打開時彈出確認框,是否打開
? ? ?ope=confirm("確認要打開新窗口?");
? ? ?if(ope==true){
? ? ? ? ?window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ?}
? ?}

0 回復 有任何疑惑可以回復我~
#1

呢絨 提問者

為什么我那樣子不行
2016-06-05 回復 有任何疑惑可以回復我~
#2

_心若無塵落雪聽禪3217495 回復 呢絨 提問者

function Wopen(){ var mynew=confirm("是否打開新窗口?"); if(mynew==true) { window.open('http://idcbgp.cn','_blank','width=600,height=400,top=100,left=0,menubar=no,toolbar=no,scrollbars=no,status=no') } else { document.write("沒有打開新窗口!") } }
2016-06-05 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么我的代碼沒有實現(xiàn)??

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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