Specifications
Gooogle JavascriptSpecifications:
Http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
Jquery core style guidelines
Http://docs.jquery.com/JQuery_Core_Style_Guidelines
Dojo style guide
Http://o.dojotoolkit.org/developer/StyleGuide
70 expert ideas for better CSS Coding
Http://www.360doc.com/content/07/0512/12/18868_495822.shtml
Standardized inspection tools
Google jslint http://code.google.com/p/jslint-toolkit/
Jslint http://www.JSLint.com
Javascript lint http://www.JavaScriptLint.com/
Microsoft Ajax minifier http://aspnet.codeplex.com/releases/view/40584
Google jslint usage steps
Ensure jre1.5 or above is installed on the local machine
1. decompress the compressed package
2. Put the file to be checked in the scripts \ file directory, and change the "allowed des": ["scripts \ file"] in the config. JSON file to "allowed des": ["scripts \ file"],
3. Click Run. BAT to perform a standard check.
4. Check the out \ index.html file, check the violation, and modify the file again.
Compile JSCodeFirst, familiarize yourself with the doc \ index.htm file, have a familiarity with the standard conventions, and then write the code.
About jslintCheck other encoded files:
Jslint uses the rhino engine to execute JS checks. Run. bat uses the rhino shell to run. For reading files, the system completes the current default encoding.
Scripts \ source \ util. js
Readfile: function (PATH)
Readfile (PATH); this function is a pre-defined function of rhino shell. You can set the second parameter encoding to readfile (path, 'utf-8 '); you can analyze the UTF-8 encoding, and other encodings are also set
When vs2008 and vs2010 tools are used, the JS file is saved as a signed UTF-8 file by default [the first three bytes of the file are signatures], for such a file rhino can not deal with [can only deal with UTF-8 files without signature], in order to automate this problem, made a small tool, as shown below:
Specify the execution path of jslint, select the JS root path and the JS directory to be checked, and run the conversion command to view the result.
A green file indicates that the file complies with the specifications, and a red file indicates that the file violates the specifications. Locate the location and modify the file.
Note: js to be analyzedThe file directory cannot contain Chinese characters. Otherwise, the results cannot be displayed.
Download specific correction tool: http://jsfkit.codeplex.com/releases