Javascript format and colour (also ref to JavaScript compressor)
Ref: http://javascript.about.com/library/blformat.htm
This is my favorite formatter. I think the formatter is the best, and it is implemented using Js.
Note: I changed the formatter to a clean version without advertisement and put it in googlepage. You can directly access it through the following link:
Http://harrywu304.googlepages.com/jsformatter.htm
JavaScript code Improver
Ref: http://www.jcay.com/javascript-code-improver.html
This is also a good formatter, which is very fast and useful for those huge-level Js. It is also free of charge.
Unfortunately, local installation is required, and only Windows is required.
Simple JavaScript formatter
Ref: http://blog.djh5e.org/wp-content/jsf.html
This can be said to be the simplest formatter and JS implementation. The principle is to regard the JS Code to be formatted as the content of a function, construct a new function, and then perform the function. tostring ():
VaR initjs = "....";
Eval ("Var tmpf = function () {" + initjs + "}");
VaR ftjs = tmpf. tostring ();
Ftjs = ftjs. substring (ftjs. indexof ("{") + 1, ftjs. lastindexof ("}"));