function openWindow(){
var code = confirm("点击打开新窗口")
if (code=true){
window.open("http://www.imooc.com","width=500px,height=600px,menubar=no,toolbar=no")
}
}
var code = confirm("点击打开新窗口")
if (code=true){
window.open("http://www.imooc.com","width=500px,height=600px,menubar=no,toolbar=no")
}
}
function openWindow(){
var cf = confirm("是否打开网站")
if (cf==true){
var wangzhi = prompt("请输入网站")
window.open('wangzhi','_blank')
}
}
var cf = confirm("是否打开网站")
if (cf==true){
var wangzhi = prompt("请输入网站")
window.open('wangzhi','_blank')
}
}
prompt(str1, str2);
str1: 要显示在消息对话框中的文本,不可修改
str2:文本框中的内容,可以修改
str1: 要显示在消息对话框中的文本,不可修改
str2:文本框中的内容,可以修改
2016-03-25
进行页面显示初始化的js必须放在head里面,因为初始化都要求提前进行(如给页面body设置css等);而如果是通过事件调用执行的function那么对位置没什么要求的。
2016-03-25
<input type="button" value="改变颜色" onClick="changeColor()
<input type="button" value="改变宽高" onClick="changeSize()
<input type="button" value="隐藏内容" onClick="hideConent()
<input type="button" value="显示内容" onClick="showConent()
<input type="button" value="取消设置" onClick="cancelSet()
<input type="button" value="改变宽高" onClick="changeSize()
<input type="button" value="隐藏内容" onClick="hideConent()
<input type="button" value="显示内容" onClick="showConent()
<input type="button" value="取消设置" onClick="cancelSet()
<script text="text/javascript"></script>
2016-03-25
顺序的原因,把<p id="con">JavaScript</p>,移动到13行,先执行js,就显示正常了
2016-03-25