Open amatiasq opened 10 years ago
Did you find solution for this?
No, I moved to another library.
Which library?
Sorry I don't remember, it's more than one year ago.
Ok. Path.rescue did the work for me. Thanks anyways.
@amatiasq The way I do it in pure JS is:
var routeFunc = function() {
var page = document.location.hash.split('=');
switch (page[0]) {
case '#!archive':
// some code
break;
case '#!home':
// some code
break;
default:
// some code
}
};
var initFunc = function() {
routeFunc();
window.addEventListener('hashchange', routeFunc, false);
};
window.addEventListener('load', initFunc, false);
You'll have to prefix all urls with #!
like in the following example: #!post=test_page
I'm using the same code in my blog - https://github.com/wifiextender/wifiextender.github.io/blob/master/dev/src/main.js#L105
Hey there, I need some way to capture any type of URL change, is there a way to do this? Something like