Skip to Main Content
Adobe® Dreamweaver® CS4 Bible
book

Adobe® Dreamweaver® CS4 Bible

by Joseph Lowery
March 2009
Beginner to intermediate content levelBeginner to intermediate
1321 pages
46h 24m
English
Wiley
Content preview from Adobe® Dreamweaver® CS4 Bible
477
Using Behaviors
12
When this code is triggered, a small dialog box appears with your query (here, ‘Whom shall I
say is calling?’
) and a blank space for an input string. The second argument in the prompt()
method enables you to include a default answer—to leave it blank, just use an empty string (two
single quotes with nothing in between), as shown in the preceding code snippet.
You can use either single or double quotes in your Call JavaScript behavior; Dreamweaver
automatically adjusts for whichever you choose. I find it easier to use single quotes because
Dreamweaver translates double quotes into character entities; that is, becomes ".
Naturally, you can use Call JavaScript to handle more complex chores as well. To call a specific cus-
tom function that is already in the
<head> section of your page, just enter its name—along with any
necessary arguments—in the Call JavaScript dialog box, shown in Figure 12-4.
FIGURE 12-4
Trigger any JavaScript function by attaching a Call JavaScript behavior to an image or text.
To use the Call JavaScript behavior, follow these steps:
1. Select the object to trigger the action.
2. From the Behaviors panel, click the Add (+) button and select Call JavaScript.
3. In the Call JavaScript dialog box, enter your code in the JavaScript text box.
4. Click OK when you’re finished.
Change Property
The Change Property action enables you to dyna
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Adobe® Dreamweaver® CS5 Bible

Adobe® Dreamweaver® CS5 Bible

Joseph W. Lowery
Dreamweaver® CS3 Bible

Dreamweaver® CS3 Bible

Joseph W. Lowery

Publisher Resources

ISBN: 9780470382523Purchase book