Always use the jssyntax Check Tool of http://www.jslint.com/to check the syntax of javascript.
I save the home page as an MHT file, which can be checked locally without having to connect to the Internet every time. Not long ago, I switched 2000 of the operating system to XP. If I didn't open the local MHT page, Javascript script execution will be automatically prohibited and manual switching is required, which is very troublesome.
Bytes
However, this script will stop when it encounters the first syntax error and start the command line to call it, which is inconvenient.
I modified this script to easily check the syntax of JS files, or call it in the uestudio (ultraedit) integrated environment.
Run the following command in resource manager:
- Decompress the downloaded file to a directory.
- Right-click the desktop shortcut and choose "jslint. Bat" to create a shortcut on the desktop.
- In resource manager, drag the JS file to be checked to the created shortcut. In the pop-up DOS window, you can see the result of the syntax check, and you can know the row and column number with errors, error cause and errorCode. Press any key to close the window.
Called in the uestudio (ultraedit) Integrated Environment:
In the integration environment, you can check the syntax of the JS file being edited through the menu or shortcut key, or double-click the row to locate the error.
- Open the uestudio menu: "Advanced/toolbar configuration...". The tool configuration dialog box is displayed.
- On the command tab, insert a command named "jslint". Run the command "cscript path \ jslint_wsh.js // nologo % F/ue" and replace the path with the decompressed path of the downloaded file.
- On the output tab, select "output to list box" and click OK.
- Open the JS file for syntax check and select "Advanced/jslint" in the menu. You can view the check result in the output window, or double-click the corresponding error line to locate it.
known issues:
Cannot check the JS file in UTF-8 format, because the opentextfile function of JavaScript reads the file in UTF-8 format will generate garbled code, do not know who has the solution.
(resolved)
You can only locate rows in uestudio, but cannot locate columns.
This script can be applied to the Visual Studio integrated environment at the same time. For details, see Javascript script syntax check in the vs integrated environment.
File Download: Download