home / experts / javascript / column23 |
|
There are several ways to communicate between the host page and the behavior scriptlet. Event-based communication is described later in this column. The other mechanism by which the caller document can pass information to the scriptlet is by passing a parameter to a pre-defined function of the scriptlet. You specify the function name in the scriptlet body, using the
where BehaviorID is the ID of the relevant Behavior, as specified in the Behavior-type Implements element of the behavior scriptlet, and notificationFunction is a user-defined function, written in the scriptlet body.
The notification function should have one parameter. The caller document passes one of the following possible values to the notification fucntion:
attachNotification() method, we can replace the attachEvent() statement with an attachNotification() one. In its current version, the scriptlet attaches the "onload" event to the window object:
and the
Instead, we can communicate the notification function name to the caller document:
and define the
|
Created: August 11, 1998
Revised: August 11, 1998
URL: http://www.webreference.com/js/column23/notify.html