Dogstudio / highway

Highway - A Modern Javascript Transitions Manager
https://highway.js.org/
MIT License
1.43k stars 92 forks source link

Sending form without reloading the page #58

Closed Kacperell closed 4 years ago

Kacperell commented 5 years ago

Hi! I have form on my website. I use preventDefault(), so I don’t overload the page.

 e.preventDefault();
    axios
        .post(this.action)
        .then(res => {  …

Without router ajax query returns me data from my node.js server and I can make changes on the website. On the server it looks like this res.json(data); And this date is my response to Axios. But when I use highway.js it’s different. Res.json() render pure site with json data. I can’t understand why. I check it in firefox network monitor normally is status 200 POST Cause XHR. But when I use router Cause is : document .