2

I have re-written this description as the original was not clear at all, I think I can summarize this much easier with:

using node.js, is it possible to update the client side DOM without leaving the original connection open that created the page headed and body, and doing a response.write() with each new update ??

Effectively I am looking to update the page in the browser from node.js after the page has loaded and the connection closed ??

Thanks

2
  • Your choices are AJAX polling or websockets... Commented Feb 9, 2013 at 11:02
  • Thanks, can you elaborate a bit ?? Commented Feb 9, 2013 at 11:30

1 Answer 1

1

The way I see it, this has nothing to do with whether you use node.js or PHP or whatever, if you want to modify the DOM on the client side, after the HTTP request finishes, these are your two options. Either you

  • use a combination of javascript's setTimeout() and requests to the XHR object to poll a JSON or HTML fragment (I won't go into AJAX polling here), or

  • use websockets. These are connections that stay open so you can pass messages back and forth while your page is running. Look it up.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.