求一段弹出消息的javascript代码 就是打开网页弹出一个对话框,有“确定” “取消” 点点击确定就 新窗口打开一个设定的页面 点击取消 就留在当前页面 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>window.onload = test;function test(){ if(confirm("打开新浪网站?")){ open("http://www.sina.com.cn"); }}</script> <!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><STYLE> #out{ width:240px; height:100px; position:absolute; border:1px solid #999; z-index:10000; background:#CCC; display:none;}#yes{ margin-left:60px; margin-top:1px;}#no{ margin-left:10px;}</STYLE> <script src="jquery-1.3.2.js"></script><script>$(document).ready(function(){ $("#test").click(function(){ $("#out").show(); }); $("#yes").click(function(){ open("http://www.g.cn"); }); $("#no").click(function(){ $("#out").hide(); return; });});</script></head><body><input type="button" id="test" value="点一下" /><br /><div id="out"> <center><h3>弹出提示</h3></center> <input type="button" id="yes" value="确定" /> <input type="button" id="no" value="取消" /></div></body></html>这是全部完整的代码,在ff中运行就可以看到,不过我用的是jquery库 <script>window.onload = test;function test(){if(confirm("打开新浪网站?")){window.href.location="http://www.sina.com.cn";}}</script> <script type="text/javascript">window.onload = test;function openWin(){ if(confirm("new window?")){ window.href.location="http://www.baidu.com"; }}</script><body><input type="button" value="newwindow" onclick="openWin()"/></body> <script>window.onload = test;function test(){if(confirm("打开百度网站?")){open("http://www.baidu.com");}}</script> 请问如何实现页面的首部和尾部的textarea联动? JS+html内容显示的不全怎么办? 碰到上左边框判断后不越界,可碰到下右边框判断后越界? select的onchange如何打开页面默认触发? js滚动条,崩溃中。。。各路朋友进来瞧瞧 jquery $.ajax jsonp 跨域的问题,总是提示passerror 我现在想把ie浏览器的菜单去掉,请问有什么方法? 如何计算字符长度??? 跨浏览器的脚本 当我点击页面中间的内容时。如何让页面的滚动条保持不动?100分求答案。 jquery的问题 验证正整数
window.onload = test;function test(){
if(confirm("打开新浪网站?")){
open("http://www.sina.com.cn");
}
}
</script>
<!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>
<STYLE>
#out{
width:240px;
height:100px;
position:absolute;
border:1px solid #999;
z-index:10000;
background:#CCC;
display:none;
}
#yes{
margin-left:60px;
margin-top:1px;
}
#no{
margin-left:10px;
}
</STYLE>
<script src="jquery-1.3.2.js"></script>
<script>
$(document).ready(function(){
$("#test").click(function(){
$("#out").show();
});
$("#yes").click(function(){
open("http://www.g.cn");
});
$("#no").click(function(){
$("#out").hide();
return;
});
});
</script>
</head>
<body>
<input type="button" id="test" value="点一下" /><br />
<div id="out">
<center><h3>弹出提示</h3></center>
<input type="button" id="yes" value="确定" />
<input type="button" id="no" value="取消" />
</div>
</body>
</html>这是全部完整的代码,在ff中运行就可以看到,不过我用的是jquery库
window.onload = test;function test(){
if(confirm("打开新浪网站?")){
window.href.location="http://www.sina.com.cn";
}
}
</script>
window.onload = test;
function openWin(){
if(confirm("new window?")){
window.href.location="http://www.baidu.com";
}
}
</script><body>
<input type="button" value="newwindow" onclick="openWin()"/>
</body>
<script>
window.onload = test;function test(){
if(confirm("打开百度网站?")){
open("http://www.baidu.com");
}
}
</script>