1、新窗口打開時彈出確認框,是否打開 提示: 使用 if 判斷確認框是否點擊了確定,如點擊彈出輸入對話框,否則沒有任何操作。 2、通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/ 3、打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
1、新窗口打開時彈出確認框,是否打開
提示: 使用 if 判斷確認框是否點擊了確定,如點擊彈出輸入對話框,否則沒有任何操作。
2、通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
3、打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
2017-09-01
<script?type="text/javascript"> ????????//創建方法體 ????function?xxx(){ ????//confirm()方法是彈出對話框?點擊確認就返回true?點擊取消就返回false ????//創建confirm()對話框并將其返回值賦予新定義的變量con ????var?con?=?confirm("是否打開網站");// ????//在利用if判斷語句?判斷變量con是否等于true?如果是就輸出window.open()否則不做任何操作 ????if(con==true){ ????window.open("www.xianlaiwan.cn","_blank","width=400,height=500"); ????} </script> <input?type="button"?value="確認框"?onclick="xxx()"/> //創建一個按鈕通過onclick點擊事件觸發xxx()方法體2017-08-31
function openWindow()
{
????var choice = confirm("是否確認打開?");
????if(choice==true)
????{
????? ? var input=prompt("請輸入需要打開的網頁網址:","http://www.xianlaiwan.cn");
????????window.open(input,"_blank","width=400,height=500,menubar=no,toolbar=no");
????}
}
2017-08-31
<script type="text/javascript">
????function open(){
? ? var con = window.confirm("是否打開");
????if(con==true){window.open("www.xianlaiwan.cn","_blank","width=400,height=500");}
</script>
<input type="button" value="確認框" onclick="open()"/>
2017-08-31
function blank(){
var a=comfirm("是否打開");
if(a){
var b=prompt("確定打開網址","http://www.xianlaiwan.cn/");
window.open('b','aaa','width=400,height=500,menuebar=no,toolbar=no');
}
}