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 write a simple VBScript page

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces "how to write a simple page of VBScript". In daily operation, I believe that many people have doubts about how to write a simple page of VBScript. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to write a simple page of VBScript". Next, please follow the editor to study!

A simple page

Use Microsoft? Internet Explorer can view pages made with the following HTML code. If you click the button on the page, you can see the running result of VBScript.

A simple home page

A simple home page

The result is a little simple: a dialog box displays a Latin phrase (which means "looks very beautiful"). However, this code actually does a lot of things.

When Internet Explorer reads the page, it finds the tag, recognizes the VBScript code, and saves the code. When the button is clicked, Internet Explorer connects the button to the code and runs the process.

The Sub procedure in the tag is an event procedure. The procedure name consists of two parts: one is the button name, Button1 (obtained from the NAME attribute in the tag), and the other is the event name, & # 111nClick. The two parts are connected by an underscore (_). When the button is clicked, Internet Explorer finds and runs the corresponding event procedure, Button1_onClick.

Internet Explorer defines events that can be used for form controls in the Internet Explorer Scripting Object Model document.

The page can also use a combination of controls and procedures. VBScript and the form show some simple interactions between controls.

Other ways to attach code to events

The above method is probably the simplest and most commonly used, but you can also use the other two methods to attach VBScript code to the event. One way is to add shorter internal code to the markup that defines the control. For example, when a button is clicked, the following tag performs the same action as the previous example:

Notice that the function call is enclosed in single quotation marks and the string of the MsgBox function is enclosed in double quotation marks. As long as you separate statements with a colon (:), you can use multiple statements.

Another way is to specify specific controls and events in the tag:

Because tags specify events and controls, you no longer need to use Sub and End Sub statements.

At this point, the study on "how to write a simple VBScript page" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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