Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

hash history


Hashjax

A simple wrapper for the history jquery plugin

  1. Define page patterns like: nodes/{id}/view
  2. User goes to yourpage.html#nodes/42/view
  3. An element of your choice loads content (through ajax) of yourbackend.php?id=42
  4. Back button works!

The history plugin mentioned above is required.
If you want to have support for in page links (the usual function of a hash), just put them after a colon. For example: index.html#page/to/load:header-to-scroll-to. You must also include http://plugins.jquery.com/project/ScrollTo for scrolling to work.

Go to the website if you want to make sure you have the latest version.

This plugin is still buggy, and I think it doesn't work in ie6. Please comment any bugs you find.

jQuery HashChange

jQuery interface to browser hashchange events, providing implementation for many browsers that do not support hashchange.

Usage is simple - just register for the hashchange event on the window:

$(window).hashchange(function() { updateState(location.hash) });

Note that, unlike the jquery history plugin, a hashchange event is NOT generated on document ready - only if the hash changes after page load. In most cases it is still desirable to set state based on the initial hash, so the following pattern is useful:

$(document).ready(function() {
        $(window).hashchange(function() { updateState(location.hash) });
        updateState(location.hash);
});