PRB: Placement of <Script> Tag Results in Unexpected Behavior (152981)
The information in this article applies to:
- Microsoft Visual Basic, Scripting Edition 1.0
- Microsoft Visual Basic, Scripting Edition 1.1
- Microsoft Visual Basic, Scripting Edition 2.0
This article was previously published under Q152981 SYMPTOMS
Microsoft Internet Explorer supports both JavaScript and VBScript
functionality. For compatibility reasons, the default is JavaScript. If a
block of <Form> code is placed ahead of a block of <script> code, errors
may result.
RESOLUTION
To prevent these errors, always place <script> tags ahead of any objects
that call into functions defined with the tags. By moving the <script> tag
and associated code ahead of the form definition, the VBScript compiler is
invoked and the Button element correctly references the function it calls
in the onClick event.
STATUS
This behavior is by design. Internet Explorer 3.0 defaults to JavaScript
compilation.
Modification Type: | Major | Last Reviewed: | 11/17/2003 |
---|
Keywords: | kbFAQ kbScript KB152981 |
---|
|