Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crossroads - 404 on route #159

Open
virtapoika opened this issue Mar 6, 2017 · 1 comment
Open

Crossroads - 404 on route #159

virtapoika opened this issue Mar 6, 2017 · 1 comment

Comments

@virtapoika
Copy link

virtapoika commented Mar 6, 2017

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... :(

@Standa666
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants