課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
rec2函數(shù)的if其實是判斷用戶點擊確認還是取消,但是點擊取消還是會打開空白網(wǎng)頁!怎么改動 這個if呢
2016-10-19
源自:JavaScript入門篇 2-6
正在回答
我改好了 ?可行
? <script type="text/javascript">
? ? ?function rec()
? ? ?{
? ? ? ? function rec2(){
? ? ? ? ? ? var myweb=prompt("網(wǎng)址?");
? ? ? ? ? ? if(myweb!=null) {
? ? ? ? ? ? window.open(myweb,'_blank','width=600,height=400,top=100,toolbar=yes,scrollbar=yes,status=yes,menubar=yes,left=0');}
? ? ? ? ? ? else{alert("寫的啥?????");}}
? ? ? ? ? ? var mymessage=confirm("你想大步往前邁嘛?");
? ? ? ? ?if (mymessage==true){rec2();}
? ? ? ? ?else
? ? ? ? ? ?{ ?
? ? ? ? ? ? var mymessage1=confirm("你真的不愿意?");
? ? ? ? ? ? if (mymessage1==true) {alert("拜拜咯");
? ? ? ? ? ? document.write("好吧,不強求你咯~撒由那拉");
? ? ? ? ? ? window.close();}
? ? ? ? ? ? else {alert("我知道你是個好孩紙!");
? ? ? ? ? ? rec2();}?
? ? ? ? ? }?
? ? }
? </script>
prompt的第二個參數(shù)得是一個網(wǎng)址才可以啊,http://www顯然不行啊
? var myPrompt=prompt("是否要打開這個窗口?","http://idcbgp.cn");??? if(muPrompt!=null)??? {??????? window.open('http://www.immoc.com',_'blank','width=400,hight=500,meunbar=no,toolbar=no')??? }
不知道這樣行不行.
舉報
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
2 回答求大神指教!
4 回答一些小問題,求指教
1 回答求大神指教!
5 回答新手求指教
3 回答點擊按鈕不出效果,求指教
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-10-20
我改好了 ?可行
? <script type="text/javascript">
? ? ?function rec()
? ? ?{
? ? ? ? function rec2(){
? ? ? ? ? ? var myweb=prompt("網(wǎng)址?");
? ? ? ? ? ? if(myweb!=null) {
? ? ? ? ? ? window.open(myweb,'_blank','width=600,height=400,top=100,toolbar=yes,scrollbar=yes,status=yes,menubar=yes,left=0');}
? ? ? ? ? ? else{alert("寫的啥?????");}}
? ? ? ? ? ? var mymessage=confirm("你想大步往前邁嘛?");
? ? ? ? ?if (mymessage==true){rec2();}
? ? ? ? ?else
? ? ? ? ? ?{ ?
? ? ? ? ? ? var mymessage1=confirm("你真的不愿意?");
? ? ? ? ? ? if (mymessage1==true) {alert("拜拜咯");
? ? ? ? ? ? document.write("好吧,不強求你咯~撒由那拉");
? ? ? ? ? ? window.close();}
? ? ? ? ? ? else {alert("我知道你是個好孩紙!");
? ? ? ? ? ? rec2();}?
? ? ? ? ? }?
? ? }
? </script>
2016-10-19
prompt的第二個參數(shù)得是一個網(wǎng)址才可以啊,http://www顯然不行啊
2016-10-19
? var myPrompt=prompt("是否要打開這個窗口?","http://idcbgp.cn");
??? if(muPrompt!=null)
??? {
??????? window.open('http://www.immoc.com',_'blank','width=400,hight=500,meunbar=no,toolbar=no')
??? }
不知道這樣行不行.