已采纳回答 / 慕九州7930838
你好,我来解答一下你这个问题。<...code...>首先是先需要执行if判断条件的语句的,即要先执行confirm(""),若执行结果为真,则执行设置语句;如果为假,则判断失败,跳出循环。
2016-05-28
window.open('http://www.imooc.com','_blank','width=600,height=400,margin-top=100,margin-left=0')
2016-05-28
function Wopen(){
alert("页面会在原页面打开");
var xxx=prompt("点击取消返回原页,或请输入你想进入的网址:", "http://");
if (xxx == null){
window.open('http://www.imooc.com/code/412','_self', 'scrolling=yes' )
}else{
window.open(xxx,'_self', 'scrolling=yes');
}
}
alert("页面会在原页面打开");
var xxx=prompt("点击取消返回原页,或请输入你想进入的网址:", "http://");
if (xxx == null){
window.open('http://www.imooc.com/code/412','_self', 'scrolling=yes' )
}else{
window.open(xxx,'_self', 'scrolling=yes');
}
}
2016-05-28
function openWindow()
{var new1;
var new2;
new1=confirm("是否打开本网页");
if(new1==true)
{
new2=prompt("开这个?","http://www.imooc.com/")
if(new2!=null)
{window.open(new2,"_blank",'width=400px,height=500px ,menubar=no,toolbar=no');
}
else
{alert("你再一次失去了本宝宝");
}
}
else{
alert("你将失去本宝宝");
}
}
{var new1;
var new2;
new1=confirm("是否打开本网页");
if(new1==true)
{
new2=prompt("开这个?","http://www.imooc.com/")
if(new2!=null)
{window.open(new2,"_blank",'width=400px,height=500px ,menubar=no,toolbar=no');
}
else
{alert("你再一次失去了本宝宝");
}
}
else{
alert("你将失去本宝宝");
}
}
function openWindow(){
var newpage=confirm("你是否需要打开新网页?");
if(newpage==true){
var tanchu=prompt("请输入幕课网网址");
if(tanchu=="http://www.imooc.com"){
window.open("http://www.imooc.com","_blank",width=400,height=500)}
else{
alert("请输入正确的网址")
openWindow()
}
}else{
alert("你即将离开本页面")}
}
var newpage=confirm("你是否需要打开新网页?");
if(newpage==true){
var tanchu=prompt("请输入幕课网网址");
if(tanchu=="http://www.imooc.com"){
window.open("http://www.imooc.com","_blank",width=400,height=500)}
else{
alert("请输入正确的网址")
openWindow()
}
}else{
alert("你即将离开本页面")}
}