PDA

View Full Version : Please help with my OnClick problem, i think.


daSilvia
01-22-2005, 12:33 AM
Hi all, I'm new here. :)

I put my hand up to update our company website http://www.drillquip.com and have run into a problem. I'm still only learning about HTML and just starting on JavaScript so please bear with me. My previous experience has been with basic WYSIWYG editors.

Anyway, to the problem... The page has obviously been written to suit IE, so I've been trying to get it to work with FireFox, my browser of choice. It originally looked like this http://www.drillquip.com/indexold.htm and I have finally worked out how to get it to look legible in FireFox, but while patting myself on the back, I neglected to check if the main page links would work. Of course they don't... What's more confusing is that the links in the frame DO work while using the same javascript instruction. It seems to work in IE and Opera satisfactorily.

Sorry for the novel. If you can help that would be great, thank you!!

Thanx
Randal

coothead
01-22-2005, 03:23 AM
Hi there daSilvia,

and a warm welcome to these forums :)

Try it like this, modifications are hi-lighted...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

<meta NAME="keywords" CONTENT="Drill bits, Hammers, Reverse Circulation, Down Hole Hammer Drilling,
DTH, Drill Rod, Exploration Drilling, Construction Drilling, Drill Blast, Perth, Western Australia ">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/default.css">
<title>INTERNATIONAL DRILLQUIP</title>

</head>
<body>

<table id="MAIN" border="0" cellpadding="0" cellspacing="0">
<!--<colgroup>
<col class="blackcol">
<col bgcolor="#d4c9a7">
</colgroup>-->
<tr>

<td class="blackcol" height="40">
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td align="right" class="blackcol">&nbsp;</td>
<td class="menu" style="color:#d4c9a7" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='pages/home.htm'">Home</td>
</tr></table>
</td>

<td>
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='pages/news.htm'">News</td>
<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='pages/products.htm'">Products</td>
<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='pages/resources.htm'">Resources</td>
<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='pages/technology.htm'">Technology</td>
<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='pages/company.htm'">Company</td>
<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='pages/contacts.htm'">Contacts</td>
<!--<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="ldocument.getElementById('PAGE').src='clients.htm'">Clients</td>
<td class="menu" onmouseover="this.className='menuover'" onmouseout="this.className='menu'"
onclick="document.getElementById('PAGE').src='testimonials.htm'">Testimonials</td>-->
<td style="border-bottom:1px solid #990000">&nbsp;</td>
</tr></table>
</td>

</tr><tr>
<td class="blackcol">
<table border="0" cellpadding="0" cellspacing="0"><tr >
<td align="right" colspan="2" ><img src="images/drillquip2.gif" width="180" height="80" alt="" /></td>
</tr><tr>
<td colspan="2" height="15">&nbsp;</td>
</tr><tr >
<td width="1000">&nbsp;</td>

<td align="right">
<table style="color:#D4C9A7;width:180px" border="0" cellpadding="2" cellspacing="0"><tr >
<td colspan="2" nowrap="nowrap"><b>Products</b></td>
</tr><tr>
<td colspan="2">
<ul>
<li class="product" onmouseover="this.className='productover'" onmouseout="this.className='product'"
onclick="document.getElementById('PAGE').src='pages/products/co_hammers.htm'">DTH Hammers</li>
<li class="product" onmouseover="this.className='productover'" onmouseout="this.className='product'"
onclick="document.getElementById('PAGE').src='pages/products/rc_hammers.htm'">RC DTH Hammers</li>
<li class="product" onmouseover="this.className='productover'" onmouseout="this.className='product'"
onclick="document.getElementById('PAGE').src='pages/products/co_bits.htm'">Drill Bits</li>
<li class="product" onmouseover="this.className='productover'" onmouseout="this.className='product'"
onclick="document.getElementById('PAGE').src='pages/products/rc_bits.htm'">RC Drill Bits</li>
<li class="product" onmouseover="this.className='productover'" onmouseout="this.className='product'"
onclick="document.getElementById('PAGE').src='pages/products/other.htm'">Other Products</li>
<li class="product" onmouseover="this.className='productover'" onmouseout="this.className='product'"
onclick="document.getElementById('PAGE').src='pages/products/services.htm'">Consultancy Services</li>
</ul>
</td>
</tr></table>
</td>

</tr><tr>
<td colspan="2">&nbsp;</td>
</tr><tr>
<td align="center" colspan="2"><img src="images/quality2.gif" alt="" /></td>
</tr><tr >
<td height="1">&nbsp;</td>
</tr><tr >
<td align="center" colspan="2" height="20">
<script type="text/javascript" src="http://www.altavista.com/static/scripts/translate_engl.js"></script></td>
</tr><tr>
<td colspan="2" style="color:#D4C9A7;" valign="top" height="50">
<center>Find the Babble Fish converter <br>at the bottom of each page.</center></td>
</tr><tr>
<td>&nbsp;</td>
</tr></table>
</td>
<td><iframe id="PAGE" src="pages/home.htm" frameborder="0"></iframe></td>
</tr></table>

</body>
</html>


"veni, vidi, validatio." ~ I came, I saw, I validated :cool:

daSilvia
01-22-2005, 09:29 AM
EDIT: That worked like a dream, thanx coothead!! :) I'm still trying to understand why it works, but I've only just started reading my "JavaScript for Dummies" book. I'll get there...
Thanx
Randal

Thank you very much for the welcome and the help, coothead!! :)
I'll whack that in and analyse it so I understand what is happening, and hopefully remember for next time.

Thanx again,
Randal