function openWindow(){
var sure = confirm("确认是否打开新窗口?");
if(sure){
var website = prompt("请输入你要打开的网址:","http://www.imooc.com/");
if(website != null)
window.open(website,'_blank','width=400,heigth=500,menubar=no,toobar=no');
}
}
var sure = confirm("确认是否打开新窗口?");
if(sure){
var website = prompt("请输入你要打开的网址:","http://www.imooc.com/");
if(website != null)
window.open(website,'_blank','width=400,heigth=500,menubar=no,toobar=no');
}
}
function openWindow(){
var w= window.open('http://www.imooc.com/',"width:400px,height:500px,menubar=no,toolbar=no");
var q=confirm("是否打开网页");
if(q==true){
w.open();
}
else{
w.close();
}
}
var w= window.open('http://www.imooc.com/',"width:400px,height:500px,menubar=no,toolbar=no");
var q=confirm("是否打开网页");
if(q==true){
w.open();
}
else{
w.close();
}
}
最赞回答 / 肖恩是程序员
if (b!=null) { window.open(b,'width=400,height=500,menubar=no,todbar=no'); }b元素不用‘b’就可以了
2016-08-07
<script type="text/javascript">
function rec(){
var mymessage=confirm("你认为我帅吗") ;
if(mymessage==true)
{
document.write("我曹 太有眼光了!");
}
else
{
document.write("你个瞎子!");
}
<input name="button" type="button" onClick="rec()" value="帅哥鉴定" />
function rec(){
var mymessage=confirm("你认为我帅吗") ;
if(mymessage==true)
{
document.write("我曹 太有眼光了!");
}
else
{
document.write("你个瞎子!");
}
<input name="button" type="button" onClick="rec()" value="帅哥鉴定" />
2016-08-06
var mychar= document.getElementById("con").innerHTML;;
document.write("结果:"+mychar); //输出获取的P标签。
document.write("结果:"+mychar); //输出获取的P标签。
2016-08-06