473,854 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

this javascript won't work in Firefox

LRW
(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.
I know, IE is a bit more permissive than IE, and sometimes lets errors
work
when they shouldn't. But from what I can see, I just don't see what's
wrong.
I must have SOMETHING wrong, but I don't see what.

I know the page does have some HTML 4 errors. The W3C validation erros
though aren't anything that should be affecting javascript, however.

Could someone give me a clue what might be preventing this from
working?

Oh, it's the toggling the display block/none at the bottom of the
page.
Here's the URL, and I'll also paste the relevant code below too.

Thanks!
Liam

http://gto.ie-studios.net/item.php?itemid=3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Games To Order - Your online discount superstore for all your
gaming
needs</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="JavaS cript" type="text/JavaScript">
<!--\ function make_vis(e)
{
var WX = e;
if (WX=="d")
{
subtbl_desc.sty le.display = "block";
} else {
subtbl_desc.sty le.display = "none";
}
if (WX=="r")
{
subtbl_rev.styl e.display = "block";
} else {
subtbl_rev.styl e.display = "none";
}
if (WX=="s")
{
subtbl_stuff.st yle.display = "block";
} else {
subtbl_stuff.st yle.display = "none";
}
} //-->
</script>--snip--<table><tr><t d> <div id="subtbl_desc "
style="display: block"
align="left"> <table width="100%"> <tr> <td width="100%">
TEXT 1 HERE </td>
</tr> </table>
</div>
<div id="subtbl_rev " style="display: none" align="left">
<table> <tr> <td>
TEXT 2 HERE </td> </tr> </table>
</div>
<div id="subtbl_stuf f" style="display: none" align="left">
<table> <tr> <td>
TEXT 3 HERE </td> </tr> </table>
</div></td>
</tr>
</table>
Jul 23 '05 #1
5 2223
In article <37************ **************@ posting.google. com>,
ne**@celticbear .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_des c".
Look in Firefox's JavaScript Console (Tools menu), then look up
getElementById( ).

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #2
LRW
Hywel Jenkins <hy**********@h otmail.com> wrote in message news:<MP******* *************** **@news.individ ual.net>...
In article <37************ **************@ posting.google. com>,
ne**@celticbear .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_des c".
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.getEle mentById("subtb l_desc").style. display = "block";
} else {
document.getEle mentById("subtb l_desc").style. display = "none";
}
if (WX=="r")
{
document.getEle mentById("subtb l_rev").style.d isplay = "block";
} else {
document.getEle mentById("subtb l_rev").style.d isplay = "none";
}
if (WX=="s")
{
document.getEle mentById("subtb l_stuff").style .display = "block";
} else {
document.getEle mentById("subtb l_stuff").style .display = "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
Jul 23 '05 #3
"LRW" <ne**@celticbea r.com> wrote in message
news:37******** *************** ***@posting.goo gle.com...
Hywel Jenkins <hy**********@h otmail.com> wrote in message news:<MP******* *************** **@news.individ ual.net>...
In article <37************ **************@ posting.google. com>,
ne**@celticbear .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_des c".
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:


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(sp 1), in case that makes a difference.
Jul 23 '05 #4
LRW
"Danny@Kend al" <da***@STOPSPAM ghpkendal.co.uk > wrote in message news:<pr******* *************@e clipse.net.uk>. ..
"LRW" <ne**@celticbea r.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(sp 1), in case that makes a difference.


Grrflippingrr.
I didn't know that when you open the JavascriptConso le 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
Jul 23 '05 #5
JRS: In article <37************ **************@ posting.google. com>,
dated Fri, 3 Dec 2004 08:48:31, seen in news:comp.lang. javascript, LRW
<ne**@celticbea r.com> posted :
if (WX=="d")
{
document.getEle mentById("subtb l_desc").style. display = "block";
} else {
document.getEle mentById("subtb l_desc").style. display = "none";
}


Consider :-

document.getEle mentById("subtb l_desc").style. display =
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.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13661
by: Steven Green | last post by:
I did a clean install of Windows XP on my computer and my javascript will not work. I've tried all types of browsers, I've download the Service pack 1 for XP and IE. I have download java from Sun, which I know is not javascript but it could not hurt. I have done everything I know of to fix this problem but still Javscript will not work on my windows XP. I don't know where to turn from here, Microsoft surely does not have any info about...
6
4212
by: b. hotting | last post by:
Hi, I don't see why this won't work, it are 3 links, the last one (a get) does work, but the first 2 won't. i would like to use a post, through hidden input types any idea? thanks for your help! bjorn
3
1620
by: Motion Musso aka: Sathia | last post by:
function up(bpid) { image = document.getElementById('up_'+bpid); image.setAttribute('SRC','/templates/images/yespulse.gif') up_down('/up_down.php?bpid=' + bpid + '&action=up'); image.setAttribute('SRC','/templates/images/rated_up.gif')
3
1513
by: Igal | last post by:
hay. i'm working on some site, the code is pretty old, it has some form validation JS scripts. but seems like they work only in IE, won't work with FireFox. here's a example: <script language="JavaScript" type="text/javascript"> <!-- function check1(){ if (form1.name.value==""){ alert("type your name"); form1.name.focus();
2
9147
by: Altman | last post by:
I have created an ascx control and I am calling registerclientscriptblock. The path to the js file is relative to the aspx page and not the ascx file. The function runs fine in IE7 but in Firefox the error console says that the function is not defined. I tried making a very basic js file to get it to work and I am having the same problem. My js file is as follows function testjs() { alert("test fired");
2
1036
by: Sky Kast | last post by:
I'm running Firefox on a win 98 computer and javascript won't work And yes i have set everything javascript that should enable to true or check so it's not that
3
1546
by: neoseeker191 | last post by:
It works fine in Firefox 2+ but in IE7 the alert window doesnt appear and the script doesnt work. Maybe I'm missing something Heres the form the script is tied to: <form id="Quiz" name="Quiz" method="get" > <table width="405" table="table" height="24" border="0" align="center"> <!--DWLayoutTable-->
1
1843
by: damiensawyer | last post by:
Hi, I've recently moved up to Framework 3.5. For some reason, a method signature on dataAdaptor.fill that used to work has stopped. DataTable oDT = new DataTable(); SqlDataAdapter oDA = new SqlDataAdapter(SQLLoadString, clsGlobalFunctions.oSQLConnection); oDA.Fill(oDT, "Movies"); //Error
0
9901
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9750
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11024
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10744
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9510
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7909
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4150
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.