對嗎?為什么沒有彈出對話框
function openwindow(){
? ? var url=prompt("你確認打開嗎?"'http://www.xianlaiwan.cn');
? ? if(url!=null)
{
? ? ?
window.open(url,"_blank","width=400,height=500,menubar=no,toolbar=no") ;
}
?}
function openwindow(){
? ? var url=prompt("你確認打開嗎?"'http://www.xianlaiwan.cn');
? ? if(url!=null)
{
? ? ?
window.open(url,"_blank","width=400,height=500,menubar=no,toolbar=no") ;
}
?}
2019-11-18
舉報
2019-11-20
你這個判斷寫的不對,URL返回值是真或者假,不是空類型
2019-11-18
// 可以參考一下??
function openWindow() {
? ? // 新窗口打開時彈出確認框,是否打開
? ? var openwindow = confirm("confirm openning?");
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? if (openwindow == true) {
? ? ? ? var url = prompt("enter you url:");
? ? ? ? if (url == null) {
? ? ? ? ? ? framework("http://www.xianlaiwan.cn");
? ? ? ? } else {
? ? ? ? ? ? framework("http://" + url);
? ? ? ? }
? ? }
? }
?
? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? function framework(url) {
? ? window.open(url, '_blank', 'width=400, height=500, menuebar=no, toolbar=no')
? }
2019-11-18
是不是openWindow,W沒有大寫