nodeToOffsets(theLink);
theDom.setSelection(offsets[0],offsets[1]);
BC 43
Creating a Behavior
The dreamweaver.getTokens() function
The getTokens() function is often used in the inspectBehavior() function because it does such a
good job of parsing a string. A token is a group of text characters that does not contain any of the specified
separators. Generally, the separators in a function are the parentheses that surround the arguments and the
commas that separate them. The getTokens() function takes two arguments??”the string to be parsed
and the separators??”and puts the results in an array. For example, note the following string:
doGroovoid(???false??™,??™Fanfare-Arrival??™);
To extract the two arguments from this statement, use the getTokens() function as follows:
getTokens(???doGroovoid(???false??™,??™Fanfare-Arrival??™)???,?????™(),???);
If you set this function equal to an array called argArray, you get the following results:
argArray[0] = ???doGroovoid??™;
argArray[1] = ???false??™;
argArray[2] = ???Fanfare-Arrival??™;
Usually the first element of the array, the function name, is ignored.
The dreamweaver.getElementRef() function
The getElementRef() function is used to gather browser-specific references to a particular object and
place them into an array.
Pages:
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931