Back
Question
Asked

How to AVOID page reloads in Node.js (PUG). Stuck!

Working on a manual here: https://consumersbook.herokuapp.com/

If you skip the initial animation and click on to page2 the page reloads quickly then gives you the new page.

I'm trying to get the React Virtual Dom affect. So no 'reloads'

Is the best thing to do to trigger "display: none" / "display: block" depending which page the user is viewing. So everything is display: none except the page currently being viewed. Hence no reloads.

Any alternative suggestions? Thanks


Yeah if it's all static just use CSS to toggle between states. Example: codepen.io/pugson/pen/NXGOWy

Or use AJAX to replace the page content.

Awesome :):)

The CodePen is great. Thank You!

Will work on implementing this now.