Display a code hints menu, Insert code in code view by using code hints, Edit a tag by using code hints – Adobe Dreamweaver CC 2015 User Manual

Page 378: Refreshing javascript code hints, Code hinting and syntax errors

Advertising
background image

371

Coding

Last updated 6/3/2015

Display a code hints menu

The code hints menu appears automatically as you type in Code view. But you can also display the code hints menu
manually, without typing.

1

In Code view (Window > Code), place the insertion point inside a tag.

2

Press Control+Spacebar.

Insert code in Code view by using code hints

1

Type the beginning of a piece of code. For example, to insert a tag, type a right angle bracket (<). To insert an
attribute, place the insertion point immediately after a tag name and press Spacebar.

A list of items (such as tag names or attribute names) appears.

To close the list at any time, press Esc.

2

Scroll through the list by using the scroll bar or the Up Arrow and Down Arrow keys.

3

To insert an item from the list, double-click it, or select it and press Enter (Windows) or Return (Macintosh).

If a recently created CSS style doesn’t appear in a code hints list of CSS styles, select Refresh Style List from the code
hints list. If Design view is visible, sometimes invalid code appears in Design view temporarily after you select

Refresh Style List. To remove that invalid code from Design view, press F5 to refresh after you finish inserting the style.

4

To insert a closing tag, type </ (slash).

Note: By default, Dreamweaver determines when a closing tag is needed and inserts if automatically. You can change
this default behavior so that Dreamweaver inserts a closing tag after you type the final angle bracket (>) of the opening
tag. Alternatively, the default behavior can be to insert no closing tag at all. Select Edit > Preferences > Code Hints, and
then select one of the Close Tags options.

Edit a tag by using code hints

• To replace an attribute with a different attribute, delete the attribute and its value. Then add an attribute and its value

as described in the previous procedure.

• To change a value, delete the value, and then add a value as described in the previous procedure.

Refreshing JavaScript code hints

Dreamweaver 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 errors

Code 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.

Advertising
This manual is related to the following products: