
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