The simplest way is to just remove any whitespace that follows a semicolon.
That's where most of the extra characters are, especially if you have more
than a level or two of indentation. You can also remove spaces from around
these characters:
= + - { } ( )
Those the the biggest culprits of white space in my JS, and should let you
reduce stuff a bunch. Of course, if you still want readable code, then
you'll want to be a little less complete with removing line breaks and
stuff, but if you're donig your stripping as part of the publishing
procedure, then you can just kill it all.
barneyb
-----Original Message-----
From: Brook Davies [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 8:30 AM
To: CF-Talk
Subject: Compressing _javascript_
Does anyone know of a UDF or customtag that will compress _javascript_ to
cut
down on file size? I know there are apps that do this, and I would like to
include this functionality with some of our dynamically generated pages.
Thanks!
Brook Davies
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Settle an argument for me Mark Leder
- Re: Settle an argument for me Michael Dinowitz
- Re: Settle an argument for me Thomas Chiverton
- Re: Settle an argument for me Jochem van Dieten
- Compressing Javascript Brook Davies
- RE: Compressing Javascript Daniel Mackey
- RE: Settle an argument for me Barney Boisvert
- RE: Settle an argument for me Jim Davis
- Re: Settle an argument for me Cutter (CF-Talk)
- RE: Settle an argument for me Mark Leder
- RE: Settle an argument for me Shawn Regan
- RE: Settle an argument for me Randell B Adkins
- RE: Settle an argument for me cfhelp
- RE: Settle an argument for me Mark Leder
- RE: Settle an argument for me cfhelp
- RE: Settle an argument for me Mark Leder