Skip to content
Advertisement

Node js post request without refreshing

Is it possible to complete a post request without redirecting or refreshing the page?

I am making a simple file browser in browser. The client side shows the USB stick content of the server. You know, when I open a folder, I send a string to server with the path data, so the server can send me the current folder’s content. It is very disturbing that whenever I open a folder (click on that), the page is refreshing. Any ideas?

Advertisement

Answer

If you make an AJAX request which fires when you open the folder, the page will not refresh. You can set up a route on your server that will handle this request and return the content.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement