我覺得是這樣,大神們請指點下
function openWindow(){ ? ?var openWindow=confirm("你確認(rèn)打開新窗口嗎"); ? ?if(openWindow==true) ? ?{ ? ?window.open('http://yifanck.cn','_blank','width=400,height=500,menubar=no,toolbar=no'); ? ?} ? ?else ? ?{ ? ?null; ? ?} ?}
2017-06-14
舉報
2017-06-15
少了一層網(wǎng)址的判斷
function openWindow()
{var abc=confirm("你是要打開慕課網(wǎng)嗎?");
if(abc==true)// 新窗口打開時彈出確認(rèn)框,是否打開
{var webadress=prompt("輸入網(wǎng)址","http://yifanck.cn/")<!--確定打開網(wǎng)址,默認(rèn)為慕課網(wǎng)-->
if (webadress!=null)
{window.open(webadress,'_blank','width=400,height=500,menubar=no,toolbar=no');}
}}
2017-06-15
你沒有寫如果需要手動輸入怎么打開網(wǎng)址哦
function openWindow(){
??????? var con = confirm("是否打開新窗口?");
??????? if(con==true){
??????????? var defaul = "http://yifanck.cn/";
??????????? var a = prompt("請輸入需要打開的網(wǎng)址:",defaul);
??????????????? if(a!=null){
??????????????????? window.open(a,'width=400,height=500,menubar=no,toolbar=no');
??????????????? }else{
??????????????????? false;
??????????????? }
??????? }else{
??????????? false;
??????? }
??? }
2017-06-14
可以的