Update a webpage every 'x' seconds?

40 views
Skip to first unread message

Tony Antony

unread,
Mar 15, 2017, 3:35:29 PM3/15/17
to nodejs
Hello,

I'm a newbie to Node.JS, I'm working on a project where it pings our servers, and if it's pinging, display green dots, if bad, display red dots.  I'm using Google maps javascript API to display the dots.

I need to figure out the ping part, but my question is, once I do that, how would I "refresh" the web page automatically?

For example, lets's say I have a server-0000, so if it pings it displays green, but if it's not pinging, display red without having to refresh the webpage every so often?

Thank you,

Tony

Matt

unread,
Mar 17, 2017, 4:25:48 PM3/17/17
to nod...@googlegroups.com
This isn't Node.js related. There's a billion ways to do it these days, from the simple use of jQuery and updating the DOM, to using a framework like Angular, Ember, or something like React. You just either periodically query the backend using setTimeout, or use WebSockets via one of the many great Node libraries for doing so, and then update your view.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/cf18ecdb-9550-4ebe-8571-5869558552c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages