Specifications
Chapter 14156
Returns
The function returns an array that contains all instances of the specified participant (or, in the
case of a group file, any instance of any participant in the group) that appear in the user’s
document. The array contains JavaScript objects, with one element in the array for each instance
of each participant that is found in the user’s document. The array is sorted in the order that the
participants appear in the document. Each JavaScript object has the following properties:
• participantNode is a pointer to the participant node in the user’s document.
• participantName is the name of the participant’s EDML file (without the .edml extension).
• parameters is a JavaScript object that stores all the parameter/value pairs.
• matchRangeMin defines the character offset from the participant node of the document to the
beginning of the participant content.
• matchRangeMax is an integer of the participant that defines the offset from the beginning of
the participant node to the last character of the participant content.
Server behavior implementation functions
These functions can be added or edited within the HTML script files or the specified JavaScript
files that are listed within the HTML script file.
dwscripts.findSBs()
Availability
Dreamweaver MX (this function replaces findSBs() from earlier versions of Dreamweaver)
Description
Finds all instances of a server behavior and all the participants on the current page. Sets the title,
type, participants array, weights array, types array, selectedNode, and incomplete flag. This
method also creates a parameter object that holds an array of user-definable properties such as
recordset, name, and column name. You can return this array from the
findServerBehaviors()
function.
Arguments
serverBehaviorTitle is an optional title string that is used if no title is specified in the EDML
title (useful for localization).
Returns
An array of JavaScript objects where the required properties are defined. Returns an empty array
if no instances of the server behavior appear on the page.
Example
The following code searches for all instances of a particular server behavior in the current user
document:
function findServerBehaviors() {
allMySBs = dwscripts.findSBs();
return allMySBs;
}