Using JavaScript Syntax Coloring

JavaScript Syntax Coloring can be applied to JavaScript code within a PHP file or a JavaScript file.

 

 

Instructions on how to complete a procedure

To enable JavaScript syntax coloring:

Enter the relevant  JavaScript tags:

javascript_code.png

Any code enclosed in the JavaScript tags will have Syntax Coloring applied to it, according to the configuration in the JavaScript Syntax Coloring Preferences page

javascript_sc_example.png

JavaScript Syntax Coloring Configuration

JavaScript Syntax Coloring options can be configured from the JavaScript Syntax Coloring preferences page.

 

 

Instructions on how to complete a procedure

To configure JavaScript Syntax Coloring options:

  1. Go to the JavaScript Syntax Coloring preferences page, accessed from Window | Preferences | JavaScript | Editor | Syntax Coloring.

JavaScript Syntax Coloring Preferences Page

  1. Select the required item from the Syntax element list.
    To enable Syntax Coloring for the element, ensure the "Enable" checkbox is marked.

  2. Select a color to apply to the text.

  3. Select what formatting, if any, you would like to apply to the text (Bold, Italic, Strikethrough, Underline).

Note:

The Sample text box displays a preview of the different elements.

  1. Click Apply and OK to apply and save your settings.

 

 

link_icon.png

Related Links:

JavaScript Support

Developing with JavaScript

Syntax Coloring

Enabling JavaScript Support in PHP Projects

Setting the JavaScript Build Path