Overview of the Scriptlets Architecture

Scripting components (from which the name Scriptlet comes) provide you with an easy but powerful way to create controls from Web pages that use Microsoft DHTML. Web pages are actually HTML files. You can use scriptlets as you would use ordinary controls in pages viewed with IE4, and in development environments such as Visual Basic or Visual InterDev as well.

A scriptlet is composed of one or more HTML pages and may include anything you can embed: mostly images, but also controls, other Web pages, marquees, sounds, and applets. It is based on DHTML and you can use it anywhere that accepts ActiveX controls.

Basically, a scriptlet is an HTML-compliant document with the usual

.htm
extension, which may also be viewed as a stand-alone page with enabled Web browsers. The screenshot below shows IE4 putting one of Microsoft's demo scriptlets through its paces. The file is
calendar.htm
. You can download this file from the Microsoft Web site (
http://www.microsoft.com/scripting
) or from our site, at the usual address.
 

Fig. 4.5 – A scriptlet viewed as a stand-alone page with IE4.

In the next figure, however, you can see the same

calendar.htm
file treated as a real scriptlet—that is, hosted in another HTML page which is acting as a container.

Fig. 4.6 – A scriptlet hosted in a HTML page viewed with IE4.

The scriptlet is a complete Web-ready HTML document, including some additional information that allows you to work with it as a control. This means, for instance, that it exposes properties you can get and set, methods you can call, events you can hook to, and so on.

© 1997 by Wrox Press. All rights reserved.