Express and Jade Ajax Page

I'm a PHP/Javascript guy but I am very new to ExpressJS (Node module). I just curious how does https://www.learnboost.com/ or new.myspace.com do their page via ajax.

enter image description here

The ajax response is json and compose of html, css, scripts and other stuff.

Is there a node module available? I search a lot in google but no idea if I did a correct keyword searching about this stuff.

This has nothing to do with what you used to build your backend stack (well, almost nothing). The only requirement of your back-end is that it serves the correct HTML. Your front-end javascript must then manage the response (in whatever way you want) to add it into or replace the current page.

In Express you have multiple ways of doing this. You could simply use res.render to render your Jade template and serve it, or get a little more complicated (to mirror what I see in your screenshot), and use app.render with a callback to add the HTML into a response object that you send back.

As for your comment about including the css/js in the return object, you could do that in multiple ways as well. CMS-y kind of way, where you keep a record of which css pages and scripts are required for each page, and look up these requirements on each request, and populate the css and js arrays in your return objects with the url locations of the required resources. A second option for this is the parse through the HTML returned from the app.render function, and add any css/script references to your object arrays. In either approach, your front-end javascript will have to handle the loading of these resources.

You may want to look at little more into PJAX, which can be a base for this type of load-new-page-without-full-reload pages.