Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add VBscript code to a HTML page

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to add VBscript code in the HTML page". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to add VBscript code in the HTML page".

The SCRIPT element is used to add VBScript code to the HTML page.

Marking

The VBScript code is written between pairs of tags. For example, the following code is a test process that passes a date:

There are tags at the beginning and end of the code. The LANGUAGE property is used to specify the Script language used. Because browsers can use multiple Script languages, you must specify the Script language to use here. Notice that the CanDeliver function is embedded in the comment tag (). This prevents browsers that do not recognize tags from displaying code on the page.

Because the above example is a generic function (independent of any form control), you can include it in the HEAD section of the page:

Order

...

The SCRIPT block can appear anywhere on the HTML page (in the BODY or HEAD section). However, it is best to put all the generic target Script code in the HEAD section so that all Script code is centrally placed. This ensures that all Script code is read and decoded before the BODY part invokes the code.

A noteworthy exception to the above rule is to provide internal code in the form in response to events of objects in the form. For example, the following example embeds Script code in a form in response to a button click event in the form:

Test button event

MsgBox "button clicked!"

Most Script code is in the Sub or Function process and executes only when other code is about to call it. However, you can also put the VBScript code out of the procedure, in the SCRIPT block. This type of code is executed only once when the HTML page is loaded. This allows you to initialize the data or dynamically change the appearance of the Web page when it is loaded.

Thank you for reading, the above is the content of "how to add VBscript code in the HTML page", after the study of this article, I believe you have a deeper understanding of how to add VBscript code in the HTML page, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report