When viewing lots of webpages' source code (like JS,CSS,HTML), I find them in one line. How did they make this? Do they use some tools to make it? Can we restructure it?
Thanks.
You'll find the script has been put in one line when it is 'minified'. This means that unnecessary white space and all comments have been removed. A Script file is minified to reduce the size of the JavaScript file in order to optimise it for download from the server to the client browser.
To view only the source code, press Ctrl + U on your computer's keyboard. Right-click a blank part of the web page and select View Page Source from the pop-up menu that appears.
Source code is a human-readable text written in a specific programming language. The goal of the source code is to set exact rules and specifications for the computer that can be translated into the machine's language. As a result, source codes are the foundation of programs and websites.
HTML is at the core of every web page, regardless the complexity of a site or number of technologies involved. It's an essential skill for any web professional. It's the starting point for anyone learning how to create content for the web. And, luckily for us, it's surprisingly easy to learn.
It's minified HTML, i.e. with the whitespace removed.
There are many tools that can do this, you can find them by Googling for minify HTML.
To un-minify it or beautify it as they say, you can google for beautify HTML.
The same applies to CSS. It can be minified and beautified.
Javascript can also be minified however most tools nowadays obfuscate the symbols which means that although you could beautify it, it will be harder to understand it afterwards.
The alternative to Javascript minification is the Javascript Packer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With