DHTML Scriptlets  PDF Print E-mail
Tag it:
Delicious
Furl it!
Digg
NewsVine
Reddit
YahooMyWeb
Technorati
Articles Reviews DHTML
Written by Phil Harrison   
Monday, 05 March 2007

{mos_sb_discuss:20}

A scriptlet is a Web page based on Dynamic HTML (DHTML) that you can use as a control in any application that supports controls. The scriptlet is a complete Web-ready .htm file, but it includes information that allows you to work with it as a control—you can get and set its properties, call its methods, and so on.


Scriptlets:
  • Allow Web page authors to create reusable user interface components without having to harness the full power of C, C++, or other control-building environments.
  • Allow developers using Microsoft Visual Basic®, Microsoft Visual InterDev®, and other development environments that support controls to make use of features built into Web pages.
  • Are easy to create and maintain.
  • Are small and efficient.

For example, with scriptlets you can:

  • Use the graphical and hypertext capabilities of Web pages as visually rich interfaces for your application.
  • Change the appearance and behavior of Web pages from within the host environment. For example, you can use a Visual Basic application to read information from files and then write it into the scriptlet.
  • Prototype controls that you intend to write in other environments. Because you can put scriptlets together quickly and easily, you can test ideas. When you have completed your design, you can reimplement the control in another environment—such as C++, Visual Basic, or J++—if you want greater performance or a different means of packaging your control.

How Scriptlets Work

You use a scriptlet like a standard control. In the scriptlet, you create any properties, methods, or events that you want by simply creating scripts in common active scripting languages such as JScript® (compatible with ECMA 262 language specification), Visual Basic Scripting Edition (VBScript), or another language. The scripts rely on the scripting capabilities of DHTML, which gives you a complete object model for elements on the scriptlet.

For example, a scriptlet might be a Web page that contains animation based on DHTML that moves and resizes text on the page. You can write scripts to expose properties that allow another application to set the text, speed, and direction of the animation text, as well as methods that allow another application to start, stop, and pause the animation.

Support for scriptlets is built into Internet Explorer. You can use the standard OBJECT tag to insert and work with scriptlets as you do any other object on a Web page.

To use the scriptlet in applications that support ActiveX® controls, you use a control called the scriptlet container object, which hosts the scriptlet. The host application, such as Visual Basic, uses the scriptlet container object to create a window for the scriptlet and provide a way for the host application to specify which scriptlet to use, where it displays, at what size, and so on. The scriptlet container object also provides the interface for you to set and get the scriptlet's properties, call its methods, and respond to its events.

Scriptlet Security

In a security-aware host application such as Internet Explorer, the scriptlet and any controls contained within it are subject to Internet Explorer security. For information about security settings in Internet Explorer, see Internet Explorer Help.

Typically, the security settings for the zone containing the scriptlet's server must be Medium or Low. If the setting is High, the scriptlet will not download to your computer. If you usually set custom security settings for a zone, set both "Script ActiveX controls marked safe for scripting" and "Initialize and script ActiveX controls not marked as safe" to either Prompt or Enable.

The same applies to any controls that the scriptlet contains, including other scriptlets, especially if the scriptlet contains controls that reside on a server in a different zone.

When you distribute an application that uses a scriptlet, make sure that users set the security settings in their copy of Internet Explorer to the correct level to allow them to use your scriptlets.


User reviews

There are no user reviews for this item.

Add new review




Powered by jReviews

Last Updated ( Thursday, 05 July 2007 )
 
< Prev   Next >