Forum Moderators: open

Message Too Old, No Replies

Works in Opera and Safari, but not in FireFox "hu is not defined:

         

mseven

12:54 pm on Jan 12, 2010 (gmt 0)

10+ Year Member



So im using a function to change text in a page without changing pages, it works great in other browsers, but not in forefox, when i click nothing happens, but when i look at the errorconsole in firefox it says "hu is not defined" HELP! thanks!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>index.jpg</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
td img {display: block;}body {
background-color: #000;
font-family: Verdana, Geneva, sans-serif;
color: #FFF;
font-size: 12px;
}
#text1 {
font-weight: bold;
}
.c {
color: #FFF;
font-family: "Lucida Console", Monaco, monospace;
}
.c {
font-size: 9px;
}
.c {
font-size: 12px;
}
.c {
font-family: Verdana, Geneva, sans-serif;
}
.j {
color: #993;
}
.a {
color: #FFF;
font-family: Verdana, Geneva, sans-serif;
}
.Black {
color: #000;
font-family: Verdana, Geneva, sans-serif;
}
.Banner {
font-size: 24px;
color: #FFF;
font-family: Georgia, "Times New Roman", Times, serif;
}
.White {
color: #FFF;
text-decoration: none;
}
td img {display: block;}body {
background-color: #000;
font-family: Verdana, Geneva, sans-serif;
color: #FFF;
font-size: 12px;
}
#text1 {
font-weight: bold;
}
.c {
color: #FFF;
font-family: "Lucida Console", Monaco, monospace;
}
.c {
font-size: 9px;
}
.c {
font-size: 12px;
}
.c {
font-family: Verdana, Geneva, sans-serif;
}
.j {
color: #993;
}
.a {
color: #FFF;
font-family: Verdana, Geneva, sans-serif;
}
.Black {
color: #000;
font-family: Verdana, Geneva, sans-serif;
}
.Banner {
font-size: 24px;
color: #FFF;
font-family: Georgia, "Times New Roman", Times, serif;
}
.White {
color: #FFF;
text-decoration: none;
}

.small {
font-size: 8px;
}
</style>
<!--Fireworks CS3 Dreamweaver CS3 target. Created Tue Jan 05 05:43:14 GMT+0000 (GMT) 2010-->
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="00" marginheight="0">
<center>
<script type="text/javascript">
function changeText2(){
document.getElementById('text1').innerHTML = 'Fred Flinstone';
}
function changeText(){
document.getElementById('text1').innerHTML = '... provides a comprehensive conveyancing service ...';
}
</script>

<script type="text/javascript">
function goHo() {
hu.innerHTML="... provides a comprehensive conveyancing service ...";
}
function goBo() {
hu.innerHTML="... litigation team offers expert assistance ...";
}


function goFo() {
hu.innerHTML="... offers highly competent ..."
}

function goIo() {
hu.innerHTML="... we have a strong team of solicitors ..."
}

function goWo() {
hu.innerHTML="For your peace of mind ..."
}

function goPo() {
hu.innerHTML="Problems can often arise ..."
}

function goEo() {
hu.innerHTML="Employment law ..."
}
</script>

<table border="0" cellpadding="0" cellspacing="0" width="979">
<!-- fwtable fwsrc="Law2.png" fwpage="Page 1" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "852343071" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="284" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="35" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="77" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="112" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="112" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="112" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="112" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="111" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="24" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
</tr>

<tr>
<td colspan="9"><img name="index_r1_c1" src="images/index_r1_c1.jpg" width="979" height="36" border="0" id="index_r1_c1" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="36" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="9"><img name="index_r2_c1" src="images/index_r2_c1.jpg" width="979" height="92" border="0" id="index_r2_c1" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="92" border="0" alt="" /></td>
</tr>
<tr>
<td><img name="index_r3_c1" src="images/index_r3_c1.jpg" width="284" height="49" border="0" id="index_r3_c1" alt="" /></td>
<td colspan="2" align="center" background="images/index_r3_c2.jpg" class="Black" ><a STYLE="text-decoration:none" href="index.html"><font color="#000000" >Practices</font></a></td>
<td align="center" background="images/index_r3_c4.jpg" class="White"><A STYLE="text-decoration:none" HREF="about.html"><font color="#FFFFFFF" >About Us</font></A></td>
<td align="center" background="images/index_r3_c5.jpg" class="White"><A STYLE="text-decoration:none" HREF="accre.html"><font color="#FFFFFF" >Accreditation</font></A></td>
<td align="center" background="images/index_r3_c6.jpg" class="White"><A STYLE="text-decoration:none" HREF="sol.html"><font color="#FFFFFF" >Solicitors</font></A></td>
<td align="center" background="images/index_r3_c7.jpg" class="White"><A STYLE="text-decoration:none" HREF="loc.html"><font color="#FFFFFF" >Location</font></A></td>
<td align="center" background="images/index_r3_c8.jpg" class="White"><A STYLE="text-decoration:none" HREF="contact.html"><font color="#FFFFFF" >Contact Us</font></A></td>
<td background="images/index_r3_c9.jpg"></td>
<td><img src="images/spacer.gif" width="0" height="49" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="9"><img name="index_r4_c1" src="images/index_r4_c1.jpg" width="979" height="254" border="0" id="index_r4_c1" alt="" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="right" background="images/index_r5_c1.jpg" class="Banner">Practices&nbsp;</td>
<td rowspan="2" colspan="7"><img name="index_r5_c3" src="images/index_r5_c3.jpg" width="660" height="83" border="0" id="index_r5_c3" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="58" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="2"><img name="index_r6_c1" src="images/index_r6_c1.jpg" width="319" height="25" border="0" id="index_r6_c1" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="25" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="9" align="left" valign="top" bgcolor="#2E2220">

<!-- <input type='button' onclick='changeText()' value='Conveyancing'/>
<input type='button' onclick='changeText2()' value='Change Text'/>
<p class="c"><b id='text1'>Welcome to the Services</p> -->

<a href="#" class="a" onClick="goHo()" ">Conveyancing</a>&nbsp;
<a href="#" class="a" onClick="goBo()" ">Litigation</a>&nbsp;
<a href="#" class="a" onClick="goFo()" ">Family</a>&nbsp;
<a href="#" class="a" onClick="goIo()" ">Immigration</a>&nbsp;
<a href="#" class="a" onClick="goWo()" ">Wills and Probate</a>&nbsp;
<a href="#" class="a" onClick="goPo()" ">Property Disputes</a>&nbsp;
<a href="#" class="a" onClick="goEo()" ">Employment</a>&nbsp;

<p id="hu">Please Choose A Service</p>

</td>
<td><img src="images/spacer.gif" width="1" height="50" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="9" align="right" valign="middle" Background="images/index_r8_c1.jpg" class="small"><A HREF="Privacy.html" class="White" STYLE="text-decoration:none"><font color="#FFFFFFF" >Privacy</a> ¦¦ <A HREF="contact.html" class="White" STYLE="text-decoration:none"><font color="#FFFFFF" >Contact Us&nbsp;&nbsp;&nbsp;</a></a></td>
<td><img src="images/spacer.gif" width="1" height="32" border="0" alt="" /></td>
</tr>
</table>
</center>
</body>
</html>

[edited by: Fotiman at 2:03 pm (utc) on Jan. 12, 2010]
[edit reason] Removed possibly identifying info, removed non-essential text [/edit]

Fotiman

2:05 pm on Jan 12, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld!
Each of your functions does this:
hu.innerHTML = "..."

But you've not defined hu. Before each of these statements, you could do something like this:

var hu = document.getElementById('hu');

And then it should work.

mseven

2:38 pm on Jan 12, 2010 (gmt 0)

10+ Year Member



Thanks alot! worked great.