Scripting Errors Loading Web Pages with VBScript and JScript (204339)



The information in this article applies to:

  • Microsoft Internet Explorer 5.5 for Windows NT 4.0
  • Microsoft Internet Explorer 5.0 for Windows NT 4.0
  • Microsoft Internet Explorer 4.01 for Windows NT 4.0 SP 1
  • Microsoft Internet Explorer 4.01 for Windows NT 4.0 SP 2
  • Microsoft Internet Explorer 4.0 for Windows NT 4.0
  • Microsoft Internet Explorer 5.5 for Windows 98
  • Microsoft Internet Explorer 5.0 for Windows 98
  • Microsoft Internet Explorer 4.01 for Windows 98 SP 2
  • Microsoft Internet Explorer 5.5 for Windows 95
  • Microsoft Internet Explorer 5.0 for Windows 95
  • Microsoft Internet Explorer 4.01 for Windows 95 SP 1
  • Microsoft Internet Explorer 4.01 for Windows 95 SP 2
  • Microsoft Internet Explorer 4.0 for Windows 95
  • Microsoft Internet Explorer version 6 for Windows 2000
  • Microsoft Internet Explorer version 6 for Windows 98
  • Microsoft Internet Explorer version 6 for Windows 98 Second Edition
  • Microsoft Internet Explorer version 6 for Windows Millennium Edition
  • Microsoft Internet Explorer version 6 for Windows NT 4.0

This article was previously published under Q204339

SYMPTOMS

When you attempt to view Web pages that contain both VBScript and JScript, you may receive scripting error messages, such as the following error message:
Expected end of statement

CAUSE

If Web page contains multiple scripts, the <SCRIPT> tag defaults to VBScript instead of JScript if the first script on the page is associated with the VBScript engine.

Typically, the "Expected end of statement" error message occurs when the VBScript engine encounters the semicolon at the end of the first JScript statement.

RESOLUTION

To prevent this problem from occurring on Web pages that contain multiple scripting engines, the Web page author should specify which scripting engine to use for each script tag.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

The language is set to VBScript for the whole document through the body tag, and the syntax of the event is JScript syntax, so it is expecting to see SCRIPT tags in the HEAD section to contain the function that it is calling.

  You should either add SCRIPT tags to the HEAD section, or add a language="JScript" to the INPUT tag.

Modification Type:MajorLast Reviewed:12/5/2003
Keywords:kberrmsg kbprb KB204339