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 VBScript pages

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the knowledge of "how to write a VBScript page". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

A simple page

Use Microsoft (R) Internet Explorer to view a page 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

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 documentation, which can be found on the Microsoft (R) Web site (http://www.microsoft.com).

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.

That's all for "how to write VBScript pages". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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