JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript
photo of Stephen Chapman

Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript since 2004

Format Your JavaScript

Friday June 13, 2008
Nicely formatted JavaScript is easier to read

If you have copied a JavaScript that comes from a script library or have one that you wrote that is not nicely formatted with consistent indentation and statements on separate lines then that JavaScript may be hard to read when you are trying to work out what it does.
JavaScript is much easier to read with consistent indentation and using colours to indicate the keywords, objects, text strings, and comments makes it even easier to read. Not everyone uses an editor that knows how to colour content of your JavaScript though and few editors can reformat the script for you.
The solution is to paste your JavaScript into the format form. A separate page will be opened displaying your JavaScript all nicely laid out and colour coded for you.

Format Your Javascript

Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss

Community Forum

Explore JavaScript

About.com Special Features

JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.