JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 23rd, 2000, 10:32 AM
gladius_12345 gladius_12345 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Twinsburg, OH, USA
Posts: 5 gladius_12345 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi All,

Planning to do a largish web project and I am looking at javscript to handle a good portion of it. I am assuming JS is transfered as text, like HTML, and not as byte codes, like java.

if this is correct, I wondered if anyone knows of a utilty that would compress javascripts (removing extraneous spaces, tabs, etc). Ideally it would reduce size of user variable names/functions via subsitution.

Thanks,
Dave

Reply With Quote
  #2  
Old August 1st, 2000, 02:34 PM
bdaddy bdaddy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Cambridge MA, USA
Posts: 2 bdaddy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to bdaddy
Dave,

Check this website out. It will "crunch" the javascript by only removing the whitespace and comments. It doesn't try to rename variables.
http://www.brainjar.com/js/crunch.html

As an interesting side note, this particular javascript compressor is implemented in javascript.

later,

David E. West

Reply With Quote
  #3  
Old August 1st, 2000, 05:56 PM
yduvoid yduvoid is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 51 yduvoid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
What might be a good idea is to keep all the Javascript codes on a js file so that the browser will only take the scripts it needs, it improves download time.

Reply With Quote
  #4  
Old August 6th, 2000, 01:00 AM
gladius_12345 gladius_12345 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Twinsburg, OH, USA
Posts: 5 gladius_12345 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for both pieces of advice.

The script compressor seems to work pretty well on my JS code so far, so I am happy there.

I may play with it some more and see about var/function compression. Maybe as an "add on" 2 passes, 1st build symobl table optimize names for size, 2nd then resubstitue them.

Dave

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > compressing javascripts

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap