Javascript在IE中工作正常,但在Firefox中没有

编程入门 行业动态 更新时间:2024-10-11 05:30:04
本文介绍了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中没有

本文发布于:2023-11-25 18:12:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630803.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:但在   工作   Javascript   Firefox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!