Javascript在IE中工作正常,但在Firefox中没有 [英] Javascript working fine in IE but not in firefox
本文介绍了Javascript在IE中工作正常,但在Firefox中没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var chkBoxList1= document.getElementById("ctl00_ContentPlaceHolder1_ChkAssignPages");
if(chkBoxList1 != null)
{
var chkBoxCount1= chkBoxList1.getElementsByTagName("input");
for(var i=0;i<chkBoxCount.length;i++)
{
var labelArray = checkBoxArray[i].parentNode.innerText;
for(var n=0; n<chkBoxCount1.length; n++)
{
var lblName = chkBoxCount1[n].parentNode.innerText;
if(lblName == labelArray)
{
alert('Already pages Assigned');
return false;
}
}
}
}
friends pls help me.
推荐答案
我会发布这个评论,但我不能做格式化。
我不是知道这是否能解决你的问题,但一般认为你不应该使用ctl00_ContentPlaceHolder1_ChkAssignPages这个ID可以想象会改变你,为了安全起见你应该做点什么
I would have posted this as a comment, but I couldn''t do formatting.
I don''t know if this will solve your problem, but as a general thought you should not use "ctl00_ContentPlaceHolder1_ChkAssignPages" The Id could conceivably change on you, to be safe you should do something like
var chkBoxList1= document.getElementById("<%= ChkAssignPages.ClientID");
这会让.NET每次都为你提供真实的客户ID。
This will let .NET put the real client ID in there for you each time.
这篇关于Javascript在IE中工作正常,但在Firefox中没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文