Hi there,
I'm building an AJAX (and thus JavascriptMVC) powered website (not webapp) which has pages and sub(sub) pages.
Now I want to set up a router like this:
$.route("/:page/:sub/:subsub", {page: "home", sub: "", subsub: ""});
$.route.ready();
But that doesn't seem to be working (change event not triggered for (sub(sub))pages). My controller is listening to router changes like this:
$.Controller("HistoryManager", {
"{$.route.data} page change": function (route, event, type, action, value, oldValue) {
console.log("change", route, event, type, action, value, oldValue);
}
});
What's the best way to handle route changes and still keep pretty routes. I discovered that by defining default values, I sometimes end up with ugly routes like these: #!&page=/home&sub=/subpage
I'm pretty new to the whole JMVC thing here so please explain clearly. Also, I've read about the whole documentation so links to to the docs won't help much probably.
Thanks in advance.
- Robin