JavaScript Reloader

I’m not a JavaScript guru, but I’m increasingly using jQuery and Bootstrap and am suddenly up to my neck in JS and CSS files. I recently stumbled across an interesting web page @

Unfortunately, I don’t understand exactly how it’s supposed to work, and I haven’t yet been able to do anything with it.

Am I correct in understanding that such a code should in a sense disable (or not load) a particular JS/CSS file until the user decides to use a function that somehow triggers a script that loads the related file(s)?

If so, how would one trigger it?

Also, are there other ways of achieving the same goal, or is this particular script the best way to go?


The rloader can be used to load a JavaScript file after the page has loaded. Following the doucmention you would need to determine what functionality can be broken off and handled like this. What rloader does is load a JavaScript file and after executes a callback (function). It is within the callback that code would go that depends on functionality loaded in the previous script.

To be honest I’m not certain how useful this is. I tend to think it will be more beneficial to compress and gzip all JavaScript into a single request than deal with this.

So you can put all your JS files in a folder and compress it, and they’ll still work? Or does the user somehow trigger a function that uncompresses it?

Modern browsers automatically uncompress files provided that they use the correct compression algorithm in the first place. That is a part of the HTTP 1.1 standard.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.