function openWindow(){
var checkOpen=confirm("是否打開新窗口?");
if(!checkOpen) return false;
var messageWindow=prompt("請輸入網址:","http://www.xianlaiwan.cn");
if(!messageWindow) return false;
window.open(messageWindow,'_blank','width:400,height:500,menubar:no,toolbar:no');
var checkOpen=confirm("是否打開新窗口?");
if(!checkOpen) return false;
var messageWindow=prompt("請輸入網址:","http://www.xianlaiwan.cn");
if(!messageWindow) return false;
window.open(messageWindow,'_blank','width:400,height:500,menubar:no,toolbar:no');
menubar開始的后面幾個屬性不管yes no在chrome里只有一種效果,后面幾個屬性IE大部分支持...不過這幾個屬性不算是js中的重點吧。。。
2015-10-05
var test = confirm("是否打開網頁");
if(test==true){
var message = prompt("地址:","http://www.xianlaiwan.cn");
if(message){
window.open(message+'','_blank','width=400.height=400,menubar=no,toolbar=no')}
else{
alert("網址為空!");
}
}
if(test==true){
var message = prompt("地址:","http://www.xianlaiwan.cn");
if(message){
window.open(message+'','_blank','width=400.height=400,menubar=no,toolbar=no')}
else{
alert("網址為空!");
}
}