Home > Web Front-end > JS Tutorial > body text

JavaScript online compression and formatting collection_javascript tips

WBOY
Release: 2016-05-16 18:56:30
Original
963 people have browsed it

I have found a program to compress Javascript code before and I have been using it and it works well.
http://javascriptcompressor.com/
Online compression of Javascript source code
Just clean up spaces, newlines, redundant comments, etc., especially select Shrink variables, long variable names will be reduced into single-letter variable names, and the compression ratio can usually reach 50% or less. Now that AJAX is very popular and JavaScript files are getting larger and larger, using this compression should reduce a lot of traffic burden. Moreover, after shortening the variable name, the program is not encrypted, but it will make the program difficult to understand. It can also protect copyright to a certain extent.

Today I found a code formatting program
http://elfz.laacz.lv/beautify/
You can compress the JS code Reformat it to make it easier to read. Of course, if the variable names are reduced during javascriptcompressor.com compression, the original meaningful variable names cannot be restored.
When encountering a particularly large JS file, the browser will report that it takes too long and choose not to stop. Eventually it will complete the execution.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template