且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Java脚本在Mozilla中不起作用

更新时间:2022-12-18 09:15:54


仔细检查您的代码:
Hi,
Look into your code carefully:
image.Attributes.Add("Onclick", "javascript:return toggle('" + grd.ClientID + "','" + image.ClientID + "');")



应该是这样的:



It should be like:

image.Attributes.Add("onclick", "javascript:return toggle('" + grd.ClientID + "','" + image.ClientID + "');")
//"o" should be small in onclick function of javascript.


并将其粘贴到page_Load事件中..

祝一切顺利.
--AK


and paste it inside page_Load event..

All the best.
--AK




与其添加属性,不如使用注册客户端脚本块在页面中注册javascript块 [ ^ ]

但这不应该是在IE中工作而不在Firefox中工作的原因.肯定还有其他问题.是您所有的javascript代码都在FF中执行吗?检查您是否禁用了JavaScript?

我也在此处发现了类似的问题 [
Hi,

instead of adding attribute, register javascript block in your page using Register Client Script block[^]

But this should not be the reason for working in IE and not working in Firefox. there must be some other problem. is all your javascript code execute in FF ? check if you have javascript disabled ?

i also found similar problem here[^]

hope this all information may save your time

thanks
-Amit