js 弹出框效果 要做一种 点击按钮 第一次弹出一个提示框提示“失败”点确定后返回本页面再次点击按钮 提示“成功” 并返回首页面 该怎么做呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript"> function add(){ var div=document.createElement("div"); var style={ 'position':'absolute', 'left':'0px', 'top':'0px', 'width':'100%', 'height':'100%', 'opacity':'.5', 'filter':'alpha(opacity=50)', 'backgroundColor':'black' } for(var i in style){ div.style[i]=style[i]; } document.body.appendChild(div); var dial=document.createElement("div"); var style={ 'position':'absolute', 'left':'100px', 'top':'100px', 'width':'400px', 'height':'400px', 'backgroundColor':'blue' } for(var i in style){ dial.style[i]=style[i]; } document.body.appendChild(dial); var cancel=document.createElement("input"); cancel.type='button'; cancel.value="取消"; cancel.onclick=function(){ var p=div.parentNode; p.removeChild(div); p.removeChild(dial); } dial.appendChild(cancel); var sure=document.createElement("input"); sure.type='button'; sure.value="确定"; sure.onclick=function(){ window.location.href='http://www.baidu.com'; } dial.appendChild(sure); }</script></head><body><input type="button" value="弹出对话框" onclick="add()"></body></html>类似这样试试 你可以通过jquery ui 的dialog去实现 为什么别人是正常的,我的却不正常,鄙视啊 关于onclick打开新页面的问题 js中处理字符中连续空白的函数 在IE中如何调试框架页面指定某一帧的脚本? 怎样才能在网页中调用打开.exe文件 怎样获得通过window.open新开的窗口的长宽? 还是变量的问题 在一个网页上做一个在四周飘荡的图标该如何实现? 那位大虾可以告诉我:怎么判断一个文件是否存在. 求一个能实现菜单左右滑入主体相应滑出的简单一点的js代码~~ web版电子表格,纯js写成, 需要的留言 急求jquery如何能让在JS文件在不重新加载的情况下,让一个事件只执行一次
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function add(){
var div=document.createElement("div");
var style={
'position':'absolute',
'left':'0px',
'top':'0px',
'width':'100%',
'height':'100%',
'opacity':'.5',
'filter':'alpha(opacity=50)',
'backgroundColor':'black'
}
for(var i in style){
div.style[i]=style[i];
}
document.body.appendChild(div);
var dial=document.createElement("div");
var style={
'position':'absolute',
'left':'100px',
'top':'100px',
'width':'400px',
'height':'400px',
'backgroundColor':'blue'
}
for(var i in style){
dial.style[i]=style[i];
}
document.body.appendChild(dial);
var cancel=document.createElement("input");
cancel.type='button';
cancel.value="取消";
cancel.onclick=function(){
var p=div.parentNode;
p.removeChild(div);
p.removeChild(dial);
}
dial.appendChild(cancel);
var sure=document.createElement("input");
sure.type='button';
sure.value="确定";
sure.onclick=function(){
window.location.href='http://www.baidu.com';
}
dial.appendChild(sure);
}
</script>
</head><body>
<input type="button" value="弹出对话框" onclick="add()">
</body>
</html>
类似这样试试