function openWindow()
{
if(confirm("确定打开新窗口吗?"))
{var openwindow=prompt("确定打开网址:"," http://www.imooc.com/");
if(openwindow)
{window.open(' http://www.imooc.com/','width=400px,height=500px,menubar=no,toolbar=no');
}
}
}
{
if(confirm("确定打开新窗口吗?"))
{var openwindow=prompt("确定打开网址:"," http://www.imooc.com/");
if(openwindow)
{window.open(' http://www.imooc.com/','width=400px,height=500px,menubar=no,toolbar=no');
}
}
}
看了评论才知道document.getElementById('');和document.getElementById)("").InnerHTML;不一样。。。。
2016-05-20
function openWindow(){
var answer=confirm("是否打开?");
if(answer==true){
prompt("确定你要打开的网址","http://www.imooc.com");
window.open("width=400px,height=500px","menubar=no","toolbar=no");
}
else{
alert("那就结束");
}
}
var answer=confirm("是否打开?");
if(answer==true){
prompt("确定你要打开的网址","http://www.imooc.com");
window.open("width=400px,height=500px","menubar=no","toolbar=no");
}
else{
alert("那就结束");
}
}
function openWindow(){
var yn=confirm("是否打开慕课网");
if(yn==true){
window.open('http://www.imooc.com/','_blank','width=400','height=500','merubar=no','toolbar=no');
}
else
{
alert("那你点个毛!")
}
}
var yn=confirm("是否打开慕课网");
if(yn==true){
window.open('http://www.imooc.com/','_blank','width=400','height=500','merubar=no','toolbar=no');
}
else
{
alert("那你点个毛!")
}
}
最赞回答 / 慕粉3383943
因为你 <p id="con">做为一个Web开发师来说,如果你想提供漂亮的网页、令用户满意的上网体验,JavaScript是必不可少的工具。</p> 在下面 ,但是你的<script>标签是放在上面的 程序还没有读到<p>标签你把<script>标签写在<p>标签后面 就可以执行了
2016-05-20
每一个语句都不一定是这个代码串的结尾,很可能在之后我们需要在其后面增加别的语句,在每个语句结尾加分号,可以尽量避免在之后对代码的改动中因为忘写分号而产生的bug。
2016-05-20