Technical Blog

JScripts Gets Some Love

Posted on

JScripts, my Ning app for storing JavaScript includes, has got some upgrades! At Johan‘s prodding I have added the following:

  • Include multiple JavaScripts with just one request to save time! It even has a form!
  • Tack ?minify on to a script to have JScripts compress it before transfer (more time saving!)
  • Tack ?callback=whoever on to have whoever() called after the script has loaded

11 Responses

Johan SundstrΓΆm β€’

It’s a lovely tool for anyone doing away with large load time overhead from loading (static) javascript from multiple locations, shaving off lots of needless HTTP roundtrips and queue buildup for fetching things off the same site.

One could probably craft a comfy bookmarklet common mortals could use to run on a page whose scripts they wanted to bundle up to pre-populate an (url) upload form, too. (Probably better with that small manual step, to make it easy to remove dynamically generated scripts from the bundle, and to see which linked URLs that should be removed from the page when dropping in the final optimized result.

It’s a dream to blog and web page load time optimizers all over the place. (Just wait ’til they come back for similar help with their css. πŸ˜‰

Might eventually make it support Transfer-Encoding:gzip too, by the way, where clients send Accept-Encoding:*gzip*.

Aditya β€’

I’ll switch to it if you promise it’s faster than Googlepages πŸ˜›

Singpolyma β€’

@Aditya – with minify and all I’d bet it’s faster. Google Pages is slow πŸ˜› Especially for multiple includes.

Aditya β€’

All righty then! I’ll try and make a switch and see for a few days. But what happens when Ning is taken down for upgrades?

Singpolyma β€’

@Adit – if Ning is down there’s nothing I can do… but that hasn’t happened in awhile, they are a deployed system now and try to do the work behind the scenes πŸ™‚

chaitanya.gk β€’

nice! good job…this is why im fan of your blog :p

Aditya β€’

Quick question: How do you go about minifying a multiple script request?

Aditya β€’

I tried. It gives an ‘unterminated string lateral’ error. You missed a quote somewhere? πŸ˜‰

Aditya β€’

You know what’ll be a good way to extend this? Although I’m guessing you thought about it …

Throw in an online editor for the files, so that one doesn’t have to constantly keep uploading locally stored copies πŸ˜›

Leave a Response