第一次点击页面任意位置弹出一个页面,在点击就没有反映了。 很简单啊。你放个隐藏的input,初始值为0你的body onclick的时候,如果input只为0就弹出你的要弹出的页面,同时把input值变成1以后你在点的时候因为不满足条件所以不弹出 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在<body onclick="window.open('index.jsp');">这样就可以了 呵呵,不好意思,看错需求了,<!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><title>form</title><script type="text/javascript">var a = false;function _test(){ alert(a); if(a==false) { window.open('index.html'); a = true; } }</script></head><body onclick="_test()"></body></html>这样就可以了 niuxinlong,你的思路都对,就是IE下面不能运行,Firefox可以 <script>function fun() {document.body.detachEvent('onclick',fun); alert(); }window.onload=function(){ document.body.attachEvent('onclick',fun)}</script> 如何遍历所有的radio,判断哪个是否被选中 学JavaScript的迷茫 求助正则匹配代码 火狐下JS执行效果不正常! 弹出DIV 我要问个问题,问题如下: 关于正则表达式匹配"<"和">",请高手指点。 JS去重json数据(大婶快来) 如何产生一个随机数? 求助 使用AJAX动态添加标签 再用JQ的on绑定 移入事件 BUG 关于梅花雪tree节点过滤? JavaScript如何做出日历
<!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>
<title>form</title>
<script type="text/javascript">var a = false;
function _test()
{
alert(a);
if(a==false)
{
window.open('index.html');
a = true;
}
}
</script>
</head><body onclick="_test()"></body>
</html>
这样就可以了
function fun()
{
document.body.detachEvent('onclick',fun);
alert(); }
window.onload=function(){
document.body.attachEvent('onclick',fun)
}
</script>