FP98: VBScript in Head Tag Breaks Navigation Bar Hover ButtonsID: Q178449
|
When browsing a page, you receive an error message similar to one of the following.
You will have the option to click Yes or No.An error has occurred in the script on this page.
Line: 27
Char: 15
Error: Expected 'Then'
Code: 0
Do you want to continue running scripts on this page?
These error messages may vary, depending on the type and version of your browser.Microsoft VBScript compilation error[Line: 27] 'Then'if(MSFPhover) document['MSFPnav1'].src=MSFPnav1h.src
This behavior occurs because you have added Microsoft Visual Basic Scripting Edition (VBScript) code in the <HEAD> tag of a page containing a navigation bar. When you browse the page, the browser generates an error. Hover buttons use JavaScript code in the event handlers. By placing VBScript code in the <HEAD> tag, you are setting the Internet Explorer default script environment to VBScript. This being the case, Internet Explorer will interpret your IF statement in the ONMOUSEOVER event as if it were VBScript, rather than JavaScript. When VBScript does not see a THEN to complete the IF ... THEN statement, the browser generates the error message.
To resolve this issue, use any of the three methods.
<a href="./" onmouseover="JAVASCRIPT:if(MSFPhover)
document['MSFPnav1'].src=MSFPnav1h.src"
onmouseout="JAVASCRIPT:if(MSFPhover)
document['MSFPnav1'].src=MSFPnav1n.src">
NOTE: Enter this text as a single line of HTML code.
<a href="./" LANGUAGE="JAVASCRIPT" onmouseover="if(MSFPhover)
document['MSFPnav1'].src=MSFPnav1h.src" onmouseout="if(MSFPhover)
document['MSFPnav1'].src=MSFPnav1n.src">
NOTE: Enter this text as a single line of HTML code.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Additional query words: front page
Keywords : kbdta fpedit fphtml fpscript
Version : WINDOWS:98
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: July 26, 1999