Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
History Management via popstate or hashchange.
Tag: 1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Demos
Source
README.md
package.yml

README.md

History

History Management via popstate or hashchange. Replaces the URL of the page without a reload and falls back to Hashchange on older browsers.

Build

Build via Packager, requires MooTools Core and MooTools Class-Extras to be registered to Packager already

./packager register /path/to/history
./packager build History/* > history.js

Demo

See Demos/index.html

Note that the Demo is quite rudimentary but you should get the idea!

How To Use

This plugin provides a History object.

Add a new URL

History.push('/some/url');

Handle URL Change (via back button etc.)

History.addEvent('change', function(url){
    // The URL has changed!

    // Let's reload the content
    new Request(url).get();
});

Shortcuts (more or less useful)

History.hasPushState(); // true if the Browser is modern and supports window.history.pushState

History.back(); // Goes back

History.forward(); // Goes forward
Something went wrong with that request. Please try again.