0% found this document useful (0 votes)
130 views3 pages

The Tag: by Using The Script Element You Add Vbscript Code To An HTML Page

The document discusses how to run VBScript programs in HTML documents. Programs are added within <SCRIPT> tags, which signify the start and end of script code. The LANGUAGE attribute specifies the scripting language as VBScript. Scripts can be placed throughout the HTML document and are typically found at the top or bottom. To handle browsers that don't support VBScript, the script can be enclosed in HTML comment tags (<!-- -->) so it will be ignored.

Uploaded by

Phong Ziggy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views3 pages

The Tag: by Using The Script Element You Add Vbscript Code To An HTML Page

The document discusses how to run VBScript programs in HTML documents. Programs are added within <SCRIPT> tags, which signify the start and end of script code. The LANGUAGE attribute specifies the scripting language as VBScript. Scripts can be placed throughout the HTML document and are typically found at the top or bottom. To handle browsers that don't support VBScript, the script can be enclosed in HTML comment tags (<!-- -->) so it will be ignored.

Uploaded by

Phong Ziggy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.How to run programs in this language?

* The <SCRIPT> Tag

By using the SCRIPT element you add VBScript code to an HTML page. VBScript is designed
as an extension to HTML. The web browser receives scripts along with the rest of the web
document. It is the browser's responsibility to parse and process the scripts. HTML was extended
to include a tag that is used to incorporate scripts into HTML-the<SCRIPT> tag.

You add scripts into your web pages within a pair of <SCRIPT> tags. The <SCRIPT> tag
signifies the start of the script section, while </SCRIPT> marks the end. An example of this is
shown below:

<HTML>

<HEAD>

<TITLE>Working With VBScript</TITLE>

<SCRIPT LANGUAGE="VBScript">

  MsgBox "Welcome to 4C class!"

</SCRIPT>

The browser will display like this:

LANGUAGE argument that indicates the


scripting language that will be used. The LANGUAGE argument is required

because there is more than one scripting language. Without the LANGUAGE

argument, a web browser would not know if the text between the tags was

JavaScript, VBScript or another scripting language.

Beside using LANGUAGE argument, you can using TYPE argument. For example:

<html>
<body>
<script type="text/vbscript">
document.write("Welcome to 4c class!")
</script>
</body>
</html>

You can place scripts throughout an HTML document using

pairs of <SCRIPT> tags, typically scripts are often found at either the top or

bottom of a Web document. This provides for easy reference and maintenance.

Handling Non-Supporting Browsers

 Only Microsoft's Internet Explorer supports VBScript. Usually browsers will do what they do
most frequently with text, they will display your scripts as part of the web page. Obviously, this
isn't the result you had hoped for. One simple way to address this problem is to encase your
scripts in comment tags(<!-- and -->). Below is our example script as it appears with the
addition of the comment tags:

<HTML>

<HEAD>

<TITLE>Working With VBScript</TITLE>

<SCRIPT LANGUAGE="VBScript">

<!--

  MsgBox "Welcome to 4C class!"

-->
</SCRIPT>

</HEAD>

</HTML>

Now, when a browser that does not support VBScript processes this page, it will view your script
as a comment and simply ignore it.

2. Core Language syntax

You might also like