Firefox getElementById问题 [英] Firefox getElementById problem

查看:67
本文介绍了Firefox getElementById问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的网站上有一个复选框,需要根据cookie的状态动态更改状态,我的脚本工作正常在IE中但还没有在Firefox中,我尝试了getElementById,getElementsByName并将复选框放在一个表单中并获取元素,但似乎没有任何效果,Firefox似乎无法找到复选框。


以下是我目前使用的代码

展开 | 选择 | Wrap | 行号

解决方案

嗨老兄,似乎代码没有任何问题,只需检查mozilla浏览器属性是否启用了cokkie。因为有两种方法来维护会话1)通过Cookies 2)URL重写。在大多数浏览器中,默认情况下将禁用cookie。只需检查一次。


问候

Ramanan Kalirajan


发布复选框的HTML代码。它只是一个复选框,ID是唯一的吗?您是否检查了错误控制台是否有错误?


我启用了Cookie,这里是复选框的代码

展开 | 选择 | Wrap | 行号

Hi all,

I have a checkbox on my site that needs it''s status to be changed dynamically depending on the status of a cookie, the script I have works fine in IE yet not in Firefox, I have tried getElementById, getElementsByName and placing the checkbox in a form and obtaining the element that way but nothing seems to work, Firefox can''t seem to find the checkbox.

Here is the code that I am currently using

Expand|Select|Wrap|Line Numbers

解决方案

Hi Dude, it seems there is nothing problem with the code, just check the mozilla browser property wether the cokkie is enabled or not. Because there are two methods for maintaining a session 1) through Cookies 2) URL rewritting. In most of the browser defaultly cookies will be set disabled. Just check that once.

Regards
Ramanan Kalirajan


Post the HTML code for the checkbox. Is it just a single checkbox and is the ID unique? Have you checked the error console for errors?


I have cookies enabled and here is the code for the checkbox

Expand|Select|Wrap|Line Numbers


这篇关于Firefox getElementById问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆