Dreamweaver CS4 | ![]() |
Dreamweaver CS4 Resources |
Use code hintsThe code hints feature helps you insert and edit code quickly and without mistakes. As you type characters in Code view, you see a list of candidates that automatically complete your entry. For example, when you type the first characters of a tag, attribute, or CSS property name, you see a list of options beginning with those characters. This feature simplifies the insertion and editing of code. You can also use it to see the available attributes for a tag, the available parameters for a function, or the available methods for an object. Code hints are available for several kinds of code. When you type the beginning character of a particular code type, you see a list of appropriate candidates. For example, to display a list of code hints for HTML tag names, type a right angle bracket (<). Similarly, to display JavaScript code hinting, type a period (dot operator) after an object. ![]() The code hinting feature also recognizes custom JavaScript classes that are not built in to the language. You can write these custom classes yourself or add them through third-party libraries like Prototype. The list of code hints disappears when you press Backspace (Windows) or Delete (Macintosh). For a video tutorial on code hinting, see www.adobe.com/go/lrvid4048_dw. Supported languages and technologiesDreamweaver supports code hinting for the following languages and technologies:
Display a code hints menuThe code hints menu appears automatically as you type in Code view. But you can also display the code hints menu manually, without typing.
Edit a tag by using code hints
Refreshing JavaScript code hintsDreamweaver automatically refreshes the list of available code hints as you work in JavaScript files. For example, suppose you are working in a primary HTML file and switch to a JavaScript file to make a change. That change is reflected in the list of code hints when you return to the primary HTML file. However, automatic updating works only if you edit your JavaScript files in Dreamweaver. If you edit your JavaScript files outside Dreamweaver, press Control+period to refresh the JavaScript code hints. Code hinting and syntax errorsCode hints sometimes don’t work properly if Dreamweaver detects syntax errors in your code. Dreamweaver alerts you to syntax errors by displaying information about them in a bar at the top of the page. The Syntax Error Information Bar displays the first line of code on which Dreamweaver encounters the error. As you fix errors, Dreamweaver continues to display any errors that occur later. Dreamweaver provides additional help by highlighting (in red) the line numbers where syntax errors occur. The highlight appears in the Code view of the file that contains the error. Dreamweaver displays syntax errors not only for the current page but also for related pages. For example, suppose you are working on an HTML page that uses an included JavaScript file. If the included file contains an error, Dreamweaver displays an alert for the JavaScript file as well. You can easily open the related file containing the error by clicking its name at the top of the document. You can disable the Syntax Error Information Bar by clicking the Syntax Error Alerts button in the Coding toolbar. Set code hints preferencesYou can change default preferences for code hints. For example, if you don’t want to show CSS property names or Spry code hints, you can deselect them in code hints preferences. You can also set preferences for code hint delay time and closing tags. ![]() |