Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: DHTML
Expertise: Beginner
Sep 23, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Designing Custom Components Using Scriptlets

Can I design custom components using scriptlets?


Yep, that's what they're for, actually. Scriptlets encompass a number of technologies. With Microsoft Internet Explorer 4.0, for example, scriptlets were the base technology used for creating DHTML-like components. They used an XML-like architecture to create an instance of a COM object that ran in its own instance of IE. Unfortunately, that is their biggest weakness—in order to create an IE4 scriptlet, you need to instantiate a new instance of the browser for each scriptlet, which proved to be an expensive process at best. Furthermore, scriptlets had only limited information about the environment in which they were hosted, and couldn't be used for lightweight controls because they were outside of the normal process space (which of course defeats the whole purpose of having a scriptlet).

With Internet Explorer 5.0, scriptlets were replaced with behaviors. A behavior modifies the default behavior of an HTML object (such as a DIV tag), and is considerably more friendly to the Web page environment. With a behavior, you could extend a DIV tag so that it acted like a clock, as an example. In other words, with behaviors, you extend the capabilities of the native HTML page, rather than creating what amounts to an ActiveX object to do the same thing.

Expect behaviors to become a critical part of Microsoft's Web strategy—with the current IE5 release, they still have a few minor glitches. The calling model for properties, for instance, is still a little nebulous, and multiple instances of a behavior still require separate instantiations. These known issues should be resolved with the next release of IE.

DevX Pro
Thanks for your registration, follow us on our social networks to keep up-to-date