Adobe 38040334 - Dreamweaver CS3 User Manual page 246

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

This argument is the string that the
Returns
Dreamweaver expects a string that contains a comma-separated list of the types of arguments in the function call.
The length of the list must equal the number of arguments in the function call. Argument types must be one of the
following types:
• The
argument type specifies that the argument is a navigational URL, and therefore, it should appear in
nav
the site map.
• The
argument type specifies that the argument is a dependent file URL, and therefore, it should be included
dep
with all other dependent files when a document that contains this behavior is downloaded from or uploaded to a
server.
• The
argument type specifies that the argument is both a navigational URL and a dependent URL or that it is
URL
a URL of an unknown type and should appear in the site map and be considered a dependent file when
downloading from or uploading to a server.
• The
argument type specifies that the argument is a Netscape Navigator 4.0-style object reference.
NS4.0ref
• The
argument type specifies that the argument is an Internet Explorer DOM 4.0-style object reference.
IE4.0ref
• The
argument type specifies that the argument is a simple object name, as specified in the
objName
for the object. This type was added in Dreamweaver 3.
• The
argument type specifies that the argument is none of the above types.
other
Example
This simple example of the
behavior action, which returns a function that always has three arguments (the URL to open, the name of the new
window, and the list of window properties):
function identifyBehaviorArguments(fnCallStr) {
return "URL,other,other";
}
A more complex version of the
have a variable number of arguments (such as Show/Hide Layer). For this example version of the
function, there is a minimum number of arguments, and additional arguments always come in
iorArguments()
multiples of the minimum number. In other words, a function with a minimum number of arguments of 4 may have
4, 8, or 12 arguments, but it cannot have 10 arguments:
function identifyBehaviorArguments(fnCallStr) {
var listOfArgTypes;
var itemArray = dreamweaver.getTokens(fnCallStr, '(),');
// The array of items returned by getTokens() includes the
// function name, so the number of *arguments* in the array
// is the length of the array minus one. Divide by 4 to get the
// number of groups of arguments.
var numArgGroups = ((itemArray.length - 1)/4);
// For each group of arguments
for (i=0; i < numArgGroups; i++){
// Add a comma and "NS4.0ref,IE4.0ref,other,dep" (because this
// hypothetical behavior function has a minimum of four
// arguments the Netscape object reference, the IE object
applyBehavior()
identifyBehaviorArguments()
identifyBehaviorArguments()
function returns.
function works for the Open Browser Window
function is necessary for behavior functions that
DREAMWEAVER CS3
240
Extending Dreamweaver
attribute
NAME
identifyBehav-

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents