最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

是這樣么?

<!DOCTYPE?html>
<html>
<head>
?<meta?charset="utf-8"?/>
?<meta?http-equiv="X-UA-Compatible"?content="IE=edge">
?<meta?name="viewport"?content="width=device-width,?initial-scale=1">
?<title>?new?document?</title>
?<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"?/>
?<script?type="text/javascript">
?//?新窗口打開時彈出確認(rèn)框,是否打開
?function?openWindow()?{
???var?q?=?confirm("打開窗口");
???if?(q?==?true)?{
?????var?w?=?prompt("打開窗口",?"http://yifanck.cn/");
?????if?(w?!=?null)?{
???????window.open('http://yifanck.cn',?'_blank','width=400,height=500,top=100,menubar=no,toolbar=no,?status=no,scrollbars=yes')
?????}?else?{
???????alert('你點(diǎn)擊了取消!')
???????};
????}?else?{
??????alert('你點(diǎn)擊了取消!')
???}
}
//?通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為?http://?
//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
</script>
</head>
<body>
<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>
</body>
</html>


正在回答

5 回答

if(confirm("是否打開新窗口?")){

? ? indow.open("http://yifanck.cn","_blank","width=400px,height=500px,menubar=no,toolbar=no");

? ? }

這個最簡單實(shí)現(xiàn)判斷正誤

0 回復(fù) 有任何疑惑可以回復(fù)我~

function openWindow()

? ? {

? ? ? ? var yes=confirm("新窗口打開網(wǎng)站?");

? ? ? ? if(yes)

? ? ? ? {

? ? ? ? ?url=prompt("wangzhi","http://yifanck.cn/");? ?

? ? ? ? }

? ? ? ? window.open(url,"_blank","width=400,height=500,menubar=no,toolbar=no");

? ? ? ??

? ? }


0 回復(fù) 有任何疑惑可以回復(fù)我~

你這樣的話對話框無論輸入什么網(wǎng)址打開的網(wǎng)站都是imooc? ?我也剛學(xué)? 不知道這里該怎么解決? ╮(╯▽╰)╭

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

WebSaber

把windows.open里面的網(wǎng)址改成url就能打開輸入框里面輸入的網(wǎng)址了
2018-12-17 回復(fù) 有任何疑惑可以回復(fù)我~

function openWindow(){

? ? var newwindow=confirm("是否打開慕課網(wǎng)?")

? ? if(newwindow==true)

? ? {

? ? ? ? document.write('我點(diǎn)擊了確定');

? ? ? ? window.open('http://yifanck.cn','_blank','width=500','menubar=no','toolbar=no');

? ? }

? ? else

? ? {

? ? ? ? document.write('我點(diǎn)擊了取消');

? ? }

? }


0 回復(fù) 有任何疑惑可以回復(fù)我~

function openWindow(){

? ? var newwindow=confirm("是否打開慕課網(wǎng)?")

? ? if(newwindow==true)

? ? {

? ? ? ? document.write('我點(diǎn)擊了確定')

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

? ? }

? ? else

? ? {

? ? ? ? document.write('我點(diǎn)擊了取消');

? ? }

? }


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
JavaScript入門篇
  • 參與學(xué)習(xí)       741555    人
  • 解答問題       9869    個

JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門

進(jìn)入課程
微信客服

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

幫助反饋 APP下載

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

公眾號

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