Check the code in the Examples folder of the DVD to see how Massimo handled this issue.
Only one more step remains before you??™re ready to begin testing your action.
Step 5: Inspect the behavior
Now it??™s time to add the inspectBehavior() function to the JavaScript file. Basically, this function is
called when the user double-clicks the action in the Behaviors panel. It restores the information already
entered through the parameter form and enables the user to change the parameters. In many ways,
inspectBehavior() can be considered the reverse of the applyBehavior() function: Rather than
reading the form and writing the information to the Web page, inspectBehavior() reads the information
and writes it back to the form.
Interpreting the user-input string of information from a form is referred to as parsing the string.
Dreamweaver offers several built-in functions to aid the parsing process, most of which are collectively
called with extractArgs(). The extractArgs() function is a good example of the powerful code
snippets available in the Dreamweaver MX 2004\Configuration\Shared folder.
Another key function used in inspectBehavior()is findObject(). The findObject() function??”
Massimo calls it ???the smartest piece of JavaScript ever written?????”returns an object when you give it the
object??™s name.
Pages:
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912