visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Why click on links reload page? #496

Closed elprobes closed 5 years ago

elprobes commented 5 years ago

this is the routing:

page.base('/'); page('/login', login); page('/registration', register); page('/', index); page();

when i first arrive at the home page, index is correctly called. Then inside the html generated by the index function, there is a link:

<a href="./registration">Register</a>

when i click on this link it's supposed to only replace a part of the dom, previously generated by the index function, with the html generated by the register function. The problem is that the page reloads itself when the link is clicked. Suggestions?

elprobes commented 5 years ago

Solved, sorry it was base path not correctly set.