Ok, I use the javascript sever part, including node.js. Due to performance problems, we decided to transfer one page to the server side, and not to the client side, so the server returns a fully visualized html stream back to the client.
I saw this question and the corresponding answers, but wondered if this was the best or the right approach. In particular, what is the most suitable way to create a page and run all javascript on it in js or node.js call?
Ideas I looked at:
Call the javascript code directly on the page and invert everything so that it generates the necessary html elements. Since this is urgent, I would prefer not to rewrite more than I should.
Retrieve the document with a simple iframe to generate html. But how can I point to a page in an iframe since I am a server? Undoubtedly, this simply adds another level of abstraction to the same problem.
Using the ideas described above, but I wonder if this is the right way, given some of the problems that I have encountered.
EDIT: just to clarify - I basically want to load the html page in a browser, let it complete the rendering, and then capture all the generated html for transmission to the client (saving time for rendering to the client).
javascript html
Schroedingers cat
source share