Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript usage


May 13, 2021 VBScript


Table of contents


VBScript usage


HTML is used to insert VBScript into HTML.


VBScript in HTML

To insert VBScript into HTML, the script must be written between the standard labels.

In the label, use the type property to define the scripting language "text/vbscript":

<html>
<body>
<script type="text/vbscript">
...
</script>
</body>
</html>

The IE will interpret and execute the VBScript code between the .lt;script> and the .lt;/script>

VBScript usage VBScript should not be used as a client scripting language!
Here, we use IE-only VBScript for learning.


VBScript output

When VBScript is used on an ASP page on a Web server, the statement response.write() produces output.

When we use Internet Explorer to test VBScript, we use document.write() to produce output:

Instances (Internet Explorer only)

<html>
<body>
<script type="text/vbscript">
document.write("Hello World!")
</script>
</body>
</html>

Try it out . . .

In the example above, the browser outputs "Hello World!" to the HTML page.