Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Error warning on mouseover? WHY?

Javascript error on mouseover?



2:28 pm on Feb 24, 2003 (gmt 0)

10+ Year Member

I keep getting an error message when I roll my mouse over the navigation bar. It was working earlier but I have added a couple of extra pages... Can anyone see from the code below what I have done wrong?

Any help would be greatly appreciated.

Many thanks


<table align="center" bgcolor="#FFFFF0" width="124" border="0" cellspacing="0" cellpadding="0">
<td><a href="../toc.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage 'Image12','','../images/mn11_on.gif',1)"><img name="Image12" border="0" src="../images/site.gif" width="122" height="14" alt="Site Map"></a><br>

<a href="../index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image104','','../images/mn17_on.gif',1)"><img name="Image104" border="0" src="../images/home.gif" width="122" height="14" alt="Home"></a><br>

<a href="../images/pan.gif" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','../images/mn02_on.gif',1)"><img name="Image1" border="0" src="../images/accom.gif" width="122" height="14" alt="Accommodation"></a><br>

<a onClick="PanoWindow=window.open('360tour/index.htm','PanoWindow',
'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=400,height=490'); return false;" href="../360tour/index.htm" target="_blank" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','../images/mn14_on.gif',1)"><img name="Image11" border="0" src="../images/pan.gif" width="122" height="14" alt="Tour the Rufflets Panoramas - rooms and gardens"></a><br>

<a href="../food.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','../images/mn03_on.gif',1)"><img name="Image2" border="0" src="../images/wine.gif" width="122" height="14" alt="Wine &amp; Dine"></a><br>

<a href="../special.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','../images/mn08_on.gif',1)"><img name="Image8" border="0" src="../images/spec.gif" width="122" height="14" alt="Special Offers"></a><br>

<a href="../weekend_breaks.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image107','','../images/mn16_on.gif',1)"><img name="Image107" border="0" src="../images/week.gif" width="122" height="14" alt="Weekend Breaks"></a><br>

<a href="../festive.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','../images/mn01_on.gif',1)"><img name="Image3" border="0" src="../images/fest.gif" width="122" height="14" alt="Festive Season"></a><br>

<a href="../golfpack.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','../images/mn07_on.gif',1)"><img name="Image7" border="0" src="../images/golf.gif" width="122" height="14" alt="Golf Packages"></a><br>

<a href="../wedd.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','../images/mn05_on.gif',1)"><img name="Image5" border="0" src="../images/wed.gif" width="122" height="14" alt="Weddings"></a><br>

<a href="../banq.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image103','','../images/mn22_on.gif',1)"><img name="Image103" border="0" src="../images/banq.gif" width="122" height="14" alt="Banqueting"></a><br>

<a href="../conf.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','../images/mn04_on.gif',1)"><img name="Image4" border="0" src="../images/conf.gif" width="122" height="14" alt="Conferences"></a><br>

<a href="../tariff.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image106','','../images/mn18_on.gif',1)"><img name="Image106" border="0" src="../images/tar.gif" width="122" height="14" alt="Tariff"></a><br>

<a href="../leisure.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','../images/mn06_on.gif',1)"><img name="Image6" border="0" src="../images/leis.gif" width="122" height="14" alt="Leisure Activities"></a><br>

<a href="../howto.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','../images/mn09_on.gif',1)"><img name="Image9" border="0" src="../images/find.gif" width="122" height="14" alt="Find Us"></a><br>

<a href="../enquiry.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image101','','../images/mn10_on.gif',1)"><img name="Image101" border="0" src="../images/enq.gif" width="122" height="14" alt="Enquiries"></a><br>

<a href="../enquiry.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image108','','../images/mn21_on.gif',1)"><img name="Image108" border="0" src="../images/OB.gif" width="122" height="14" alt="Online Booking"></a><br>

<a href="../links.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image102','','../images/mn15_on.gif',1)"><img name="Image102" border="0" src="../images/links.gif" width="122" height="14" alt="Links"></a>


[edited by: korkus2000 at 2:36 pm (utc) on Feb. 24, 2003]
[edit reason] fixed sidescroll [/edit]


2:33 pm on Feb 24, 2003 (gmt 0)

10+ Year Member

Looks like

onMouseOver="MM_swapImage 'Image12','','../images/mn11_on.gif',1)"

should be



2:37 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

I should learn to type faster!

<edit>Removed duplicate answer</edit>


3:00 pm on Feb 24, 2003 (gmt 0)

10+ Year Member

Thanks guys but I think that "(" some how vanished in the cutting and pasting - that bracket is in the actual code.

I wish it was so simple...it probably is something similar.



3:12 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Administrator martinibuster is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

What kind of error message do you receive?

Is it the yellow caution icon in the lower left corner of your browser?

Does your rollover image appear?

The problem may not be the code you posted. There is another script located in your head section that contains rollover related code (unless you are calling it in externally).


3:12 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member


What line number is the error appearing on? (You can tell this by double clicking on the error warning on the bottom right of the IE window - it will pop up a box giving the error and the line number).

If you could post the offending line of code it might make finding the source of the problem easier.


3:39 pm on Feb 24, 2003 (gmt 0)

10+ Year Member

It starts at line 47, which is the code that I have posted.

The error message states:-

Line 47
Char 1
Error: Object expected
Code: 0

I have posted the page on free space and have not uploaded all the linking pages yet but I don't think that is the problem.

<sorry, no URLs>

Thanks again


[edited by: tedster at 4:15 pm (utc) on Feb. 24, 2003]


3:53 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member


You don't seem to have any JavaScript in your <head> section, or a link to a js file, that defined the functions you are calling.

The browser is expecting a function for the SwapImage and SwapImgRestore calls in your html.

Is this code being generated by DreamWeaver?

PS: The URL drop will probably be snipped by a Mod!


4:13 pm on Feb 24, 2003 (gmt 0)

WebmasterWorld Administrator martinibuster is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Yup. The swap code comes in two parts. One part is in the head (or called in externally), the second part (that you posted) is in the body.

The second part invokes the first part to perform it's function.


4:56 pm on Feb 24, 2003 (gmt 0)

10+ Year Member

Thanks BlobFisk and Martinibuster....there was a bit of code missing in the header as you suggested...not sure how that happened!

Anyway I am so glad that it is working now - many thanks again.



Featured Threads

Hot Threads This Week

Hot Threads This Month