We often talk about the latest scheme for compressing and minimizing our JavaScript. The JavaScript Beautify script aims to do the opposite.
Often, you find a site that is doing something interesting and you want to learn how it works. You check out the source and it is cryptic gibberish. This is where the beautifier comes in to make it a touch more readable.
For example, it can take:
JAVASCRIPT:
-
- /* paste in your own code and press Beautify button */var latest_changes=new Object({'2007-10-17':'Many, many fixes and improvements. Processing speed is also back.','... who cares ...','2007-02-08':'Initial release'});var a=b?(c%d):e[f];
-
and gives you:
JAVASCRIPT:
Source: Ajaxian.
-
- /* paste in your own code and press Beautify button */
- var latest_changes = new Object({
- '2007-10-17': 'Many, many fixes and improvements. Processing speed is also back.',
- '... who cares ...',
- '2007-02-08': 'Initial release'
- });
- var a = b ? (c % d) : e[f];
-
No comments:
Post a Comment