登录 | 注册

首页 | 学习中心 | 下载中心 | 知识大全 | 作文 | 常识 | 加入收藏 | 网站地图

您当前位置:多思学习网知识频道电脑学习电脑知识firefox 兼容?如何让window.event在FireFox下兼容

firefox 兼容?如何让window.event在FireFox下兼容

11-08 12:39:07电脑知识
浏览次数:288次 
标签:电脑知识大全,http://www.duosi8.com firefox 兼容?如何让window.event在FireFox下兼容,
window.event 在IE和OPERA中是全局变量,而在FF中是局部变量,有什么函数可以实现让window.event在FF中变为全局变量?,
这个好像与浏览器支持有关,貌似你需要另写一个针对FF的JS!然后浏览器判断,那种浏览器用那个JS对象!
js做全选firefox兼容
firefox 兼容
我在页面表单用 <input type="checkbox" name="box[]" value="box-1" />写了几个多选,然后在js中用document.form1("box[]")得到所有checkbox的信息,在IE下没问题,可是在firefox报错说document.form1 is not a function。 请教有啥方法兼容??
<form action="" method="post" name="form1">
<script type="text/javascript">
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = form.chkAll.checked;
}
}
</script>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">选中/取消所有
<p><input name="checkbox[]" type="checkbox" value="checkbox1"> checkbox1
<p><input name="checkbox[]" type="checkbox" value="checkbox2"> checkbox2
<p><input name="checkbox[]" type="checkbox" value="checkbox3"> checkbox3
<p><input name="checkbox[]" type="checkbox" value="checkbox4"> checkbox4
<p><input name="submit" type="submit" value="提交">
</form>
<!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=gb2312" />
<title>无标题文档</title>
<script>
function checkall()
{
var menu_dd = document.getElementById('ListForm').getElementsByTagName('input');
//alert(obj);
if (document.getElementById('chkDelete').checked==true)
for (var i = 0; i < menu_dd.length-1; i++) {
menu_dd[i].checked = true;
}
else 本文来自
{
for (var i = 0; i < menu_dd.length-1; i++) {
menu_dd[i].checked = false;
}
}
}
</script>
</head>
<body>
<form id="ListForm" name="listForm">
<input type="checkbox" value="a1" /><br />
<input type="checkbox" value="a2" /><br />
<input type="checkbox" value="a3"/><br />
<input type="checkbox" value="a4" /><br />
<input type="checkbox" name="chkDelete" id="chkDelete" />全选</form>
</body>
</html>

你的JS贴出看看。
回答人的补充2010-07-07 12:49<form action="" method="post" name="form1">
<script type="text/javascript">
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = form.chkAll.checked;
}
}
</script>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">选中/取消所有
,firefox 兼容?如何让window.event在FireFox下兼容

联系我们 | 网站地图 | 幼教大全 | 试题下载 | 电脑学习 | 加入收藏


幼儿园教案_ 教案模板_ 课件模板_ 教学反思_ 教学计划


多思学习网 1 2 3 4 5 6