Bryan Pieper's Blog : jQuery

Looking for a bolt on DJango app to compress/minify your JavaScript and CSS files? I created the staticcomp Django app for just that purpose.

Benefits:

  • Ability to compress/minify JS/CSS files on-demand
  • Increase website performance by reducing the total number of JS/CSS file requests
  • Build modular JS/CSS files by page / section instead of relying on large files
  • No need to use date-based file names or query string values to force the browser to download changes to your JS/CSS files
  • Improved Google Page Speed score and SEO benefits from a faster overall website
  • Integrated with UglifyJS, the same JavaScript compressor used by jQuery
  • Allows you to create your own backends or use one of the four existing

Looking for a Javascript plugin to react to the hash value changing on your page?

The jQuery Hashchange Plugin will enable to you attach to the hashchange event for all clients.

<script type="text/javascript">
// the callback will receive the new and old hash values as arguments
$(window).hashChange(callbackFunction);

// or you can bind to the "hashChange" event
$(window).bind("hashChange", function(e, newHash, oldHash) {
    console.log("new: " +  newHash);
    console.log("old: " + oldHash);
});
</script>

Basically, everytime the hash value changes, you can respond as needed by the requirements of your page. This is useful for ajax views, tabs, and other layout changes in your page that need to be based on the hash state.

The plugin also supports Modernizr v2.0+ to detect the "hashchange" event for modern browsers.

The jquery.hashable.js the source code.

View an example HTML page.