SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1940 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"


The displayHelp() function
The displayHelp() function inserts a Help button on custom behavior dialog boxes, below the standard
OK and Cancel buttons. This function takes no arguments and is usually defined to display a help message
or file. The two typical techniques, depending on what you want to accomplish, are the alert() method
or the Dreamweaver JavaScript extension, browseDocument(). To display a brief message, use the
alert() method, as in the following code:
function displayHelp() {
alert(???This behavior works only with .rmf files.???);
}
When you need to bring up a much longer file, use the browseDocument() function:
function displayHelp() {
dreamweaver.browseDocument(???http://www.idest.com/dreamweaver/???);
}
You can also reference local files using browseDocument(). See the browseDocument() description in
the section ???Dreamweaver JavaScript API extensions,??? earlier in this chapter.
BC 53
Creating a Behavior
Do not include the JavaScript file displayHelp.js in your behaviors. This is the file that
Dreamweaver uses to call its own Help pages.
Useful Common Functions
As with most other object-oriented programming languages, it??™s good programming practice to build a function
once and recall it when needed. Dreamweaver includes a large library of such useful functions, which
are maintained in the Dreamweaver MX 2004\Configuration\Shared\MM\Scripts\CMN folder.


Pages:
1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946