How to Countdown With a Dreamweaver Clock

by Jim Campbell

To add a countdown timer in Dreamweaver, you must add some JavaScript code to the Web page. Dreamweaver has a JavaScript insertion window that helps you insert a block of JavaScript code without manually setting up the countdown timer directly in the Web page.

1

Open the Dreamweaver software. Open your Dreamweaver Web project to load all the website files.

2

Double-click the file in which you want to create a timer. Click the Dreamweaver "Insert" menu item and select "HTML." Click the "Script Objects" submenu item and click "Script" to open the script window.

3

Type the following JavaScript code into the "Content" text box in the opened JavaScript window:

var timeout=setTimeout("myfunction()",4000); function myfunction() { alert ("Time up"); }

In this example, the function "myfunction" executes after four seconds. The countdown timer is set in milliseconds. The first parameter is the function that executes when the time is reached after the user opens the Web browser.

4

Click "JavaScript" in the "Language" drop-down. Click "OK" to insert the script into the file. Save the file changes and open the file in a Web browser to test the new countdown timer.

About the Author

Jim Campbell has been a computer engineer for over five years. He excels in hardware repair, computer programming and troubleshooting, and software design. He is currently attending Florida Atlantic University, pursuing a master's degree in computer and electrical engineering and fine-tuning his technical writing abilities.