History.js definitions and tests added

This commit is contained in:
Boris Yankov committed 2012-10-13 19:43:39 +03:00
1 parent 716a5a0c49
commit 9f07758e11
2 files changed
+42

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
/// <reference path="../Definitions/history.d.ts" />
if (!History.enabled) {
return false;
}
History.Adapter.bind(window, 'statechange', () => {
var State = History.getState();
History.log(State.data, State.title, State.url);
});
History.pushState({ state: 1 }, "State 1", "?state=1");
History.pushState({ state: 2 }, "State 2", "?state=2");
History.replaceState({ state: 3 }, "State 3", "?state=3");
History.pushState(null, null, "?state=4");
History.back();
History.go(2);