-1

Is there a way to reload/refresh the contents of an HTML page without closing the open socket to the server? All the options mentioned here appear to be closing the socket.

I would like to do such a thing whenever a node server is sending a JSON message with the new values for a specific part of the page. So, the client has the new data, but apparently with jQuery I can not update the webpage. (No, the jQuery that I have already works because the first time the client is connected, the same jQuery is used to load the page. I can see the webpage fine; however, when I request to view the source code of the HTML page I can not see anywhere what I am actually seeing on the screen.)

Any ideas? Thanks in advance.

Community
  • 1
  • 1
MightyMouse
  • 13,208
  • 8
  • 33
  • 43

1 Answers1

2

The only way to avoid closing an open connection on a page is to dynamically change the page's content. As you stated, you can just use jQuery, but do note that the rendered output is different from the page's source, which is why you can't see the DOM changes you've made with JavaScript. To view the rendered source, use inspect element (may vary by browser).

hexacyanide
  • 88,222
  • 31
  • 159
  • 162