Go Back   SitePoint Forums > Forum Index > Program Your Site > JavaScript
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Dec 3, 2005, 10:03   #1
jrivesj
SitePoint Member
 
Join Date: Nov 2005
Posts: 11
JavaScript works fine in IE, not in FireFox

This has me totally stumped. Here's the code:

*********

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>AA Groups in Central Dallas</title>

<LINK REL=STYLESHEET TYPE="TEXT/CSS" HREF="main.CSS">

<script type="text/javascript" language="JavaScript">
<!--
function show(object) { if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'visible'; else if (document.all) document.all[object].style.visibility = 'visible'; }
function hide(object) { if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'hidden'; else if (document.all) document.all[object].style.visibility = 'hidden'; }
//-->
</SCRIPT>

</head>

<body>

<div id="top3"><H1 class="headerx">AA Groups in Central Dallas</H1>
<span class="normal"><strong>Click on the area in which you want to find a meeting.</strong></span></div>

<img src="Dal-Cen.gif" alt="" border="0" usemap="#Dal-C">

<map name="Dal-C">
<area alt="Gilbert St Group" coords="53,231,126,282" href="groups/oaklawn-traditional.htm#gilbert">
<area alt="Last House Group" coords="378,15,481,40" href="groups/last-house.htm">
<area alt="Campus Group" coords="195,32,258,82" href="groups/parkcities.htm">
<area alt="Highland Park Group" coords="36,69,148,109" href="groups/parkcities.htm">
<area alt="Upper Room Group" shape="poly" coords="160,108,153,117,140,119,139,131,232,133,225,116,188,110,174,85" href="groups/parkcities.htm">
<area alt="Solutions Group" shape="poly" coords="366,116,352,144,452,147,457,139,444,127,380,126" href="groups/lakewood-solutions.htm">
<area alt="Dallas AA Central Office" shape="poly" coords="363,106,342,145,285,145,285,97" href="office.htm">
<area alt="Lakewood Group" coords="350,154,434,203" href="groups/lakewood-solutions.htm">
<area alt="Belwood Group" coords="302,274,367,327" href="groups/deep-east-dallas.htm">

<area alt="Ebony/Ebonette Group" shape="poly" coords="319,370,356,362,352,376,254,411,263,430,223,425,243,394" href="groups/ebony-liveand-let-live.htm">
<area alt="Live and Let Live Group" coords="159,427,224,475" href="groups/ebony-liveand-let-live.htm">
<area alt="Traditional Group" coords="123,271,207,329" href="groups/oaklawn-traditional.htm">
<area alt="Don't Know Group" coords="33,317,122,389" href="groups/oaklawn-traditional.htm">
<area alt="Sunday Night Group" coords="38,455,102,504" href="groups/nooners-sunpm.htm">
<area alt="Downtown Nooners Group" shape="poly" coords="120,460,104,495,122,516,190,514,199,491,145,491" href="groups/nooners-sunpm.htm">
<area alt="Living Sober in Faith Group" coords="363,490,463,539" href="groups/ls-infaith.htm">

<area alt="Groups in North-Central Dallas" coords="166,2,352,16" href="dal-nc.htm" onmouseover="show('a')" onmouseout="hide('a')">

<area alt="Groups in Lake Highlands - NE Dallas - N Mesquite" coords="481,1,498,252" href="dal-ne.htm" onmouseover="show('b')" onmouseout="hide('b')">

<area alt="Groups in SE Dallas - S Mesquite" coords="482,307,498,553" href="dal-se.htm" onmouseover="show('c')" onmouseout="hide('c')">

<area alt="Groups in South-Central Dallas" coords="162,540,354,558" href="dal-sc.htm" onmouseover="show('d')" onmouseout="hide('d')">

<area alt="Groups in West-Central Dallas" coords="2,167,17,340" href="dal-wc.htm" onmouseover="show('e')" onmouseout="hide('e')">

</map>



<div id="a" class="MAP"><br><ul><li class="black">All Accepted</li><li class="black">Chicago</li><li class="black">Clean Air</li><li class="black">Cornerstone</li><li class="black">Dallas North</li><li class="black">Greenville</li><li class="black">Keystone</li><li class="black">No Hassle</li><li class="black">North Park</li><li class="black">Omega</li><li class="black">Preston</li></ul><hr><br><span class="normal">75225&nbsp; 75230&nbsp; 75231&nbsp; 75240&nbsp; 75243&nbsp; 75248&nbsp; 75251&nbsp; 75254&nbsp; 75080&nbsp; 75081</span></div>
<div id="b" class="MAP"><br><ul><li class="black">Casa</li><li class="black">Freedom (Mesquite)</li><li class="black">Lake Highlands</li><li class="black">The Rock (Sunnyvale)</li><li class="black">White Rock</li></ul><hr><br><span class="normal">75041&nbsp; 75043&nbsp; 75150&nbsp; 75214&nbsp; 75218&nbsp; 75228&nbsp; 75238</span></div>
<div id="c" class="MAP"><br><ul><li class="black">Bruton Terrace (Mesquite)</li><li class="black">Grace (Mesquite)</li><li class="black">Living Sober in Faith</li><li class="black">Mesquite Bigtown (Balch Springs)</li></ul><hr><br><span class="normal">75149&nbsp; 75180&nbsp; 75181&nbsp; 75210&nbsp; 75215&nbsp; 75217&nbsp; 75223&nbsp; 75227</span></div>
<div id="d" class="MAP"><br><ul><li class="black">Corinth</li><li class="black">Hi Nooners</li><li class="black">Kessler Park</li><li class="black">Town South</li></ul><hr><br><span class="normal">75104&nbsp; 75115&nbsp; 75134&nbsp; 75137&nbsp; 75203&nbsp; 75208&nbsp; 75211&nbsp; 75216&nbsp; 75224&nbsp; 75232&nbsp; 75233&nbsp; 75237&nbsp; 75241</span></div>
<div id="e" class="MAP"><br><ul><li class="black">Lambda</li><li class="black">Second Tradition</li><li class="black">Standing on the Promises</li><li class="black">Whitehouse</li></ul><hr><br><span class="normal">75207&nbsp; 75209&nbsp; 75219&nbsp; 75220&nbsp; 75235&nbsp; 75247</span></div>




<div class="zips">Neighboring<br>Groups / Zip Codes</div>



<br><br>

<div class="smallcx">

<p class="norm"><a href="dal.htm">Back to the Dallas County Map</a></p>

<p class="norm"><a href="index.htm">HOME</a></p>

</div>


</body>
</html>

If you look here in IE, the onmouseovers work just fine; in FireFox they totally don't work at all.

www.aadallas.org/dal-c.htm.

THANKS for your help.

Jim
jrivesj is offline   Reply With Quote
Old Dec 3, 2005, 10:46   #2
stymiee
He's No Good To Me Dead
silver trophybronze trophy
 
stymiee's Avatar
 
Join Date: Feb 2003
Location: Slave I
Posts: 24,095
Looks like you're writing code for the 4.0 browsers. Use the DOM which is cross-browser.

Also, I don't think FF supports layers so that is prob where your problem lies.
stymiee is offline   Reply With Quote
Old Dec 3, 2005, 12:17   #3
jrivesj
SitePoint Member
 
Join Date: Nov 2005
Posts: 11
Uh-oh...you've found me out ... I don't actually write JavaScript, just find applicable scripts on the WWW and modify them for my site. I'll have to go back to the drawing board, I suppose...
jrivesj is offline   Reply With Quote
Old Dec 3, 2005, 13:11   #4
stymiee
He's No Good To Me Dead
silver trophybronze trophy
 
stymiee's Avatar
 
Join Date: Feb 2003
Location: Slave I
Posts: 24,095
Yeah. Looks like the script you're using is pretty old. But the code is pretty simple. I bet it could be modified to be cross-browser compliant with the DOM pretty easily. Maybe one of our JavaScript gurus will swing by and offer some help.
stymiee is offline   Reply With Quote
Old Dec 3, 2005, 14:55   #5
Iain G
d^_^b
 
Iain G's Avatar
 
Join Date: Nov 2005
Location: Gloucester, UK
Posts: 262
Well I'm certainly no guru, but I think this should work:
Code:
function show(objID)
{
	var obj = document.getElementById(objID);

	if (obj.style.visibility == 'hidden')
		obj.style.visibility = 'visible';
}
function hide(objID)
{
	var obj = document.getElementById(objID);

	if (obj.style.visibility == 'visible')
		obj.style.visibility = 'hidden';
}
Iain G is offline   Reply With Quote
Old Dec 3, 2005, 15:17   #6
stymiee
He's No Good To Me Dead
silver trophybronze trophy
 
stymiee's Avatar
 
Join Date: Feb 2003
Location: Slave I
Posts: 24,095
Awesome
stymiee is offline   Reply With Quote
Old Dec 3, 2005, 22:48   #7
jrivesj
SitePoint Member
 
Join Date: Nov 2005
Posts: 11
THANKS! I'll give it a shot first thing tomorrow.

Jim
jrivesj is offline   Reply With Quote
Old Dec 4, 2005, 13:33   #8
felgall
Programming Since 1978
silver trophybronze trophy
SitePoint Award Recipient
 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, NSW, Australia
Posts: 10,816
If you want to support Netscape 4 you can add the layers code back in as well. If you want to support Internet Explorer 4 you need the document.all code as well. A small number of people still use Netscape 4 but I don't think anyone uses IE4 any more.
felgall is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 23:00.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved