About code validation – Adobe Extending Dreamweaver CS4 User Manual

Page 73

Advertising
background image

67

EXTENDING DREAMWEAVER CS4

Customizing Code view

</keywords>
<keywords id="CodeColor_JavascriptNumber">

<keyword>Infinity</keyword>
<keyword>Nan</keyword>

</keywords>
<keywords name="Client Keywords" id="CodeColor_JavascriptClient">

<keyword>alert</keyword>

. . .

</keywords>
<sampleText><![CDATA[/* JavaScript */

function displayWords(arrayWords) {

for (i=0; i < arrayWords.length(); i++) {

// inline comment
alert("Word " + i + " is " + arrayWords[i]);

}

}
var tokens = new Array("Hello", "world");
displayWords(tokens);
]]></sampleText>

</scheme>

JavaScript sample text
The sample text for the JavaScript scheme illustrates the JavaScript code coloring scheme as follows:

/* JavaScript */ function displayWords(arrayWords) {

for (i=0; i < arrayWords.length(); i++) {

// inline comment
alert("Word " + i + " is " + arrayWords[i]);

}

}
var tokens = new Array("Hello", "world");
displayWords(tokens);

The following lines from the Colors.xml file provide the color and style values that are seen in the sample text and were
assigned by the code coloring scheme:

<syntaxColor id="CodeColor_JavascriptComment" text="#999999" italic="true" />

<syntaxColor id="CodeColor_JavascriptFunction" text="#000000" bold="true" />
<syntaxColor id="CodeColor_JavascriptBracket" text="#000099" bold="true" />
<syntaxColor id="CodeColor_JavascriptNumber" text="#FF0000" />
<syntaxColor id="CodeColor_JavascriptClient" text="#990099" />
<syntaxColor id="CodeColor_JavascriptNative" text="#009999" />

About Code validation

When opening a document in Code view, Dreamweaver automatically validates that the document is not using any
tags, attributes, CSS properties, or CSS values that are not available in the target browsers that the user selected.
Dreamweaver underlines errors with a wavy red line.

Dreamweaver also has a new browser compatibility check feature that locates combinations of HTML and CSS that
can trigger browser rendering problems.

Advertising
This manual is related to the following products: