Quick and convenient syntax check for JS files.

Source: Internet
Author: User
Tags ultraedit

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:

    1. Decompress the downloaded file to a directory.
    2. Right-click the desktop shortcut and choose "jslint. Bat" to create a shortcut on the desktop.
    3. 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.

    1. Open the uestudio menu: "Advanced/toolbar configuration...". The tool configuration dialog box is displayed.
    2. 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.
    3. On the output tab, select "output to list box" and click OK.
    4. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.