spacer
Yehuda Shiran April 29, 2000
Scriptlets
Tips: April 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

A scriptlet is an independent script that is referenced from an HTML page. It represents an object that accepts data from the outside and supports several operations on this data. A scriptlet describes the behavior of an object and the event it is triggered by. A scriptlet also allows you to define new events. A scriptlet resides in a file of its own, with extension .sct. A scriptlet file opens with a <SCRIPTLET> tag and closes with a </SCRIPTLET> tag:

<SCRIPTLET>
...
...
</SCRIPTLET>

A scriptlet is divided into two parts: the interface definition section and the internal implementation section. The interface definition section includes IMPLEMENTS tags. Each IMPLEMENTS tag opens with and closes with </IMPLEMENTS>. There are two types of <IMPLEMENTS> tags: <Behavior> and <Automation>. The <Behavior> type specifies the event associated with the Behavior, such as the following:

<IMPLEMENTS ID="kuku" TYPE="Behavior" DEFAULT>
<EVENT NAME="onFifthBlink"/>
</IMPLEMENTS>

The Automation type of the <IMPLEMENTS> tag specifies the scriptlet's object interface parameters and supported methods:

<IMPLEMENTS TYPE="Automation">
<METHOD NAME="blink"/>
<PROPERTY NAME="x"/>
<PROPERTY NAME="y"/>
</IMPLEMENTS>

The internal implementation section consists of a JavaScript script. This script implements the internal details of the object's methods. As seen above, the blink() function is the only method defined for this behavior.

You can find the whole internal implementation of the scriptlet in Column 22, DHTML Behaviors


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2 · Create Multilingual Web Sites with Windows Unicode Fonts
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Telehealth Takes Hold In Upstate New York · Ten Wi-Fi Security Threats to Monitor · SanDisk's SSD As Rapid As It Is Reliable