• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 685
  • Last Modified:

Mouseover - MSFPhover is undefined...

I am getting a runtime errors during a mouseover event of a website I created in FrontPage 2002. Several navigation buttons are supposed to change color when the mouse rolls over them.  The page works fine when in FrontPage "Preview" mode, but is screwing up when viewed with Internet Explorer.  Therefore, I do not know if the problem is something I need to address as the web designer, or as the end-user/web-surfer...

Here are the errors that occur as the page loads into the browser:
"A Runtime error has occurred. Do you wish to debug? Line: 94.  Error: Expected ')'."
"A Runtime error has occurred. Do you wish to debug? Line: 103.  Error: 'MSFPhover' is undefined."
"A Runtime error has occurred. Do you wish to debug? Line: 105.  Error: 'MSFPhover' is undefined."
"A Runtime error has occurred. Do you wish to debug? Line: 107.  Error: 'MSFPhover' is undefined."
"A Runtime error has occurred. Do you wish to debug? Line: 118.  Error: Expected ')'."

After the page loads, I get the following (twice) when I roll over one of the nav buttons:
"A Runtime error has occurred. Do you wish to debug?  Line: 104.  Error: 'MSFPhover' is undefined."

Here's the script code as it appears in the HTML of the page, starting at Line 94:
*******************************************************

<script language="JavaScript"><!--
MSFPhover =
  (((navigator.appName == "Netscape") &amp;amp;amp;&amp;amp;amp;
  (parseInt(navigator.appVersion) >= 3 )) ||
  ((navigator.appName == "Microsoft Internet Explorer") &amp;amp;amp;&amp;amp;amp;
  (parseInt(navigator.appVersion) >= 4 )));
function MSFPpreload(img)
{
  var a=new Image(); a.src=img; return a;
}
// --></script><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav1n=MSFPpreload("_derived/services.htm_cmp_expeditn010_vbtn.gif"); MSFPnav1h=MSFPpreload("_derived/services.htm_cmp_expeditn010_vbtn_a.gif"); }
// --></script><a href="services.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1h.src" onmouseout="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1n.src"><img src="_derived/services.htm_cmp_expeditn010_vbtn.gif" width="140" height="50" border="0" alt="Our Services" name="MSFPnav1"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav2n=MSFPpreload("_derived/College.htm_cmp_expeditn010_vbtn.gif"); MSFPnav2h=MSFPpreload("_derived/College.htm_cmp_expeditn010_vbtn_a.gif"); }
// --></script><a href="College.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2h.src" onmouseout="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2n.src"><img src="_derived/College.htm_cmp_expeditn010_vbtn.gif" width="140" height="50" border="0" alt="Casino Collegeā„¢" name="MSFPnav2"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav3n=MSFPpreload("_derived/news.htm_cmp_expeditn010_vbtn.gif"); MSFPnav3h=MSFPpreload("_derived/news.htm_cmp_expeditn010_vbtn_a.gif"); }
// --></script><a href="news.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3h.src" onmouseout="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3n.src"><img src="_derived/news.htm_cmp_expeditn010_vbtn.gif" width="140" height="50" border="0" alt="News" name="MSFPnav3"></a></p>
    <!--mstheme--></font><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
      <tr>
        <td width="100%"><!--mstheme--><font face="Book Antiqua, Times New Roman, Times">
        <p align="center"><SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
if ((navigator.appName == "Microsoft Internet Explorer") &amp;amp;amp;&amp;amp;amp; (parseInt(navigator.appVersion) >= 4)) {

var url="http://www.javascriptsource.com";
var title="The JavaScript Source";

document.write('<A HREF="javascript:window.ext');
document.write('ernal.AddFavorite(url,title);" ');
document.write('onMouseOver=" window.status=');
document.write("'Add our site to your favorites!'; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('">Add our site to your favorites!</a>');
}
else {
var msg = "Don't forget to bookmark us!";
if(navigator.appName == "Netscape") msg += "  (CTRL-D)";
document.write(msg);
}

// End -->
        </script>


Any suggestions as to how to stop this madness?

Thanks!
0
Galisteo8
Asked:
Galisteo8
  • 2
  • 2
1 Solution
 
hhammashCommented:
Can you post the URL?


hh
0
 
rcmbCommented:
In the first part of your code that reads:
MSFPhover =
  (((navigator.appName == "Netscape") &amp;amp;amp;&amp;amp;amp;
  (parseInt(navigator.appVersion) >= 3 )) ||
  ((navigator.appName == "Microsoft Internet Explorer") &amp;amp;amp;&amp;amp;amp;
  (parseInt(navigator.appVersion) >= 4 )));
function MSFPpreload(img)


Change it to read:
MSFPhover =
  (((navigator.appName == "Netscape") && 
  (parseInt(navigator.appVersion) >= 3 )) ||
  ((navigator.appName == "Microsoft Internet Explorer") && 
  (parseInt(navigator.appVersion) >= 4 )));
function MSFPpreload(img)


Towards the bottom of the page you have a line that reads:
if ((navigator.appName == "Microsoft Internet Explorer") &amp;amp;amp;&amp;amp;amp; (parseInt(navigator.appVersion) >= 4)) {

Change it to read:
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

That will fix all.

RCMB
0
 
Galisteo8Author Commented:
RCMB - Worked like a charm.  Thanks!

I Java, what are the &&'s doing there? Andy why was mine all "amp'd" up?
0
 
rcmbCommented:
The && is used for:

If, and only if, both expressions evaluate to True, result is True. If either expression evaluates to False, result is False.

JScript uses the following rules for converting non-Boolean values to Boolean values:

All objects are considered true.
Strings are considered false if, and only if, they are empty.
null and undefined are considered false.
Numbers are false if, and only if, they are zero.

Why yours were incorrect is probably due to your copy method. I would recommend always pasting to notepad first and then copy and paste to frontpage.

RCMB
0
 
Galisteo8Author Commented:
Oddly, I am currently unable to publish directly from FrontPage (claims I can't make a connection to my webserver...), so I was copying and pasting code directly from FrontPage's HTML view to my website using the host server's control panel (filemanagement) functionality. Basically, I was pasting right into the HTML of the live web page. Although, now that I think of it, I don't believe I went through Notepad first, and I know MicroSoft LOVES to add a bunch of garbage to HTML code when you start pasting it around...

Thanks again.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now