function openWindow(){
if(confirm("是否打开新窗口")){
if(window.prompt("是否打开一下网址","http://www.imooc.com/")){
window.open("http://www.imooc.com/","_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
}
if(confirm("是否打开新窗口")){
if(window.prompt("是否打开一下网址","http://www.imooc.com/")){
window.open("http://www.imooc.com/","_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
}
//定义"取消设置"的函数
function cancleall(){
var cancle = confirm("cancle all ?");
if (cancle == true){
document.getElementById("txt").removeAttribute('style');
}
}
function cancleall(){
var cancle = confirm("cancle all ?");
if (cancle == true){
document.getElementById("txt").removeAttribute('style');
}
}
e...空间以前有个整蛊人的软件,点进去就显示各种“你是SB~”之类,还必须点确定,不然就离开不了当前页面,真是各种无语。
这个应该就是用alert做的吧? 这个可以用vb做的
这个应该就是用alert做的吧? 这个可以用vb做的
2015-07-30
js中保留空格的方法:
1. 使用输出html标签 来解决
document.write("  "+"1"+"    "+"23");
结果: 1 23
2. 使用CSS样式来解决
document.write("<span style='white-space:pre;'>"+" 1 2 3 "+"</span>");
结果: 1 2 3
在输出时添加“white-space:pre;”样式属性。这个样式表示"空白会被浏览器保留"
1. 使用输出html标签&nbsp;来解决
document.write("&nbsp;&nbsp;"+"1"+"&nbsp;&nbsp;&nbsp;&nbsp;"+"23");
结果: 1 23
2. 使用CSS样式来解决
document.write("<span style='white-space:pre;'>"+" 1 2 3 "+"</span>");
结果: 1 2 3
在输出时添加“white-space:pre;”样式属性。这个样式表示"空白会被浏览器保留"
2015-07-30