HighDots Forums  

Re: this javascript won't work in Firefox

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: this javascript won't work in Firefox in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hywel Jenkins
 
Posts: n/a

Default Re: this javascript won't work in Firefox - 12-03-2004 , 01:52 AM






In article <37a6c958.0412022246.5a283ac1 (AT) posting (DOT) google.com>,
news (AT) celticbear (DOT) com says...
Quote:
(Sorry if this is a repost...my newsreader keeps crashing on the
posting--I don't know if the message going out or not)

For some reason this javascript just won't work in Firefox. It works
fine in
IE, though.
It's probably because Firefox can't find an object called "subtbl_desc".
Look in Firefox's JavaScript Console (Tools menu), then look up
getElementById().

--
Hywel http://kibo.org.uk/
I do not eat quiche.


Reply With Quote
  #2  
Old   
LRW
 
Posts: n/a

Default Re: this javascript won't work in Firefox - 12-03-2004 , 11:48 AM






Hywel Jenkins <hyweljenkins (AT) hotmail (DOT) com> wrote

Quote:
In article <37a6c958.0412022246.5a283ac1 (AT) posting (DOT) google.com>,
news (AT) celticbear (DOT) com says...
(Sorry if this is a repost...my newsreader keeps crashing on the
posting--I don't know if the message going out or not)

For some reason this javascript just won't work in Firefox. It works
fine in
IE, though.

It's probably because Firefox can't find an object called "subtbl_desc".
Look in Firefox's JavaScript Console (Tools menu), then look up
getElementById().
Thanks! That was absolutely it. (Wait, I see now another problem. See
end.)
I changed it to this (for the benefit of any other clueless fellow
like myself) and it works fine:

function make_vis(e)
{
var WX = e;
if (WX=="d")
{
document.getElementById("subtbl_desc").style.displ ay = "block";
} else {
document.getElementById("subtbl_desc").style.displ ay = "none";
}
if (WX=="r")
{
document.getElementById("subtbl_rev").style.displa y = "block";
} else {
document.getElementById("subtbl_rev").style.displa y = "none";
}
if (WX=="s")
{
document.getElementById("subtbl_stuff").style.disp lay = "block";
} else {
document.getElementById("subtbl_stuff").style.disp lay = "none";
}
}

I used the Firefox JavaScript console, and while the script now works
fine, I'm STILL getting a huge list of:
Error: subtbl_desc is not defined
Source File: http://gto.ie-studios.net/item.php?itemid=1
Line: 54

I don't get it. I read about getElementById() (as evidenced by the
fact my changes work) and all I've seen have to do exactly with what
I've changed in my code.
I don't get what's still wrong. =/

Thanks for your advice! I'm glad it helped me get it working, and I'd
like to just leave it at that, but the additional warnings bug me and
it's only professional that I deal with them even though there's no
obvious effect on the site.

Thanks,
Liam


Reply With Quote
  #3  
Old   
Danny@Kendal
 
Posts: n/a

Default Re: this javascript won't work in Firefox - 12-03-2004 , 12:20 PM



"LRW" <news (AT) celticbear (DOT) com> wrote

Quote:
Hywel Jenkins <hyweljenkins (AT) hotmail (DOT) com> wrote

In article <37a6c958.0412022246.5a283ac1 (AT) posting (DOT) google.com>,
news (AT) celticbear (DOT) com says...
(Sorry if this is a repost...my newsreader keeps crashing on the
posting--I don't know if the message going out or not)

For some reason this javascript just won't work in Firefox. It works
fine in
IE, though.

It's probably because Firefox can't find an object called "subtbl_desc".
Look in Firefox's JavaScript Console (Tools menu), then look up
getElementById().

Thanks! That was absolutely it. (Wait, I see now another problem. See
end.)
I changed it to this (for the benefit of any other clueless fellow
like myself) and it works fine:

Quote:
I used the Firefox JavaScript console, and while the script now works
fine, I'm STILL getting a huge list of:
Error: subtbl_desc is not defined
Source File: http://gto.ie-studios.net/item.php?itemid=1
Line: 54
Are these *new* error messages or are they the old ones still in the
javascript console logs?

I tried your page in Firefox1.0, Opera7.54, IE6 and Mozilla1.7.3
No javascript errors showing here. Have you already fixed the problem?
My OS is WindowsXPpro(sp1), in case that makes a difference.




Reply With Quote
  #4  
Old   
LRW
 
Posts: n/a

Default Re: this javascript won't work in Firefox - 12-03-2004 , 05:42 PM



"Danny@Kendal" <danny (AT) STOPSPAMghpkendal (DOT) co.uk> wrote

Quote:
"LRW" <news (AT) celticbear (DOT) com> wrote in message
I used the Firefox JavaScript console, and while the script now works
fine, I'm STILL getting a huge list of:
Error: subtbl_desc is not defined
Source File: http://gto.ie-studios.net/item.php?itemid=1
Line: 54

Are these *new* error messages or are they the old ones still in the
javascript console logs?

I tried your page in Firefox1.0, Opera7.54, IE6 and Mozilla1.7.3
No javascript errors showing here. Have you already fixed the problem?
My OS is WindowsXPpro(sp1), in case that makes a difference.
Grrflippingrr.
I didn't know that when you open the JavascriptConsole it holds onto
the previous messages. I flushed the errors and reloaded and it now
only has one error.
Some "syntax error" with a green arrow on the 6 of the URL:

Error: syntax error
Source File: javascript: http://gto.ie-studios.net/item.php?itemid=6
Line: 1, Column: 43
Source Code:
http://gto.ie-studios.net/item.php?itemid=6

No idea what that means. Syntax seems fine to me, but I've recently
learned that half of what I learned in the late 90's on Web design has
been depricated or changed drastically. =)

Thanks!
Liam


Reply With Quote
  #5  
Old   
Dr John Stockton
 
Posts: n/a

Default Re: this javascript won't work in Firefox - 12-03-2004 , 05:46 PM



JRS: In article <37a6c958.0412030848.7d95ca22 (AT) posting (DOT) google.com>,
dated Fri, 3 Dec 2004 08:48:31, seen in news:comp.lang.javascript, LRW
<news (AT) celticbear (DOT) com> posted :

Quote:
if (WX=="d")
{
document.getElementById("subtbl_desc").style.displ ay = "block";
} else {
document.getElementById("subtbl_desc").style.displ ay = "none";
}
Consider :-

document.getElementById("subtbl_desc").style.displ ay =
WX=="d" ? "block" : "none"

(it should not affect your problem, though)

It's better not to use Tabs to structure-indent code in news posts; use
two spaces instead.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.