crossroads.js
crossroads.js copied to clipboard
Crossroads - 404 on route
Hi! I'm trying to start using crossroads. I've managed to get "/" route working but for some reason others (/account) wont work. Could you help a noobie out of this? `
var defaultRoute = crossroads.addRoute("/", function () {
$("#root").load("main.html");
});
var accountRoute = crossroads.addRoute("account", function () {
$("#root").load("account.html");
});
crossroads.parse(document.location.pathname);
`
I'm getting on url localhost:8000/ all working as I want to but on localhost:8000/account it gives 404... :(
Have you checked what comes into parse
method from document.location.pathname
.
Your root is equivalent to /
so your path should also start with slash. Try /acount
.