By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,598 Members | 1,894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,598 IT Pros & Developers. It's quick & easy.

script works in IE6 but not in FF3

Tarantulus
100+
P: 114
Hi All,

I have the following script in the head of my document

Expand|Select|Wrap|Line Numbers
  1. var state = false; function edit() {     document.getElementById('editor_area').style.display = state ? 'none' : 'inline';     document.getElementById('display_area').style.display = state ? 'inline' : 'none';     state = !state;     if (!state) document.getElementById('jump').focus(); }  
in the body the edit() function is called onclick.

it works in IE, but in FF it fails, and the error console displays "edit not defined"

can anyone explain why this is?

Thanks in advance
Jul 11 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Can you show the HTML code? Are you sure you've set the IDs of the elements?
Jul 11 '08 #2

Tarantulus
100+
P: 114
I'm sure the ID's are set, the error is referring to the function name not an element ID...
Jul 11 '08 #3

acoder
Expert Mod 15k+
P: 16,027
I can't see anything obvious (though I'm not sure why you're putting everything on one line), so the HTML code or how you're calling the function might help. It would be even better if you could put together a test page that demonstrates the problem.
Jul 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.