V
V
Vasily Melnikov2019-03-06 12:14:37
go
Vasily Melnikov, 2019-03-06 12:14:37

How to write a web server in Go that dynamically updates part of the page?

As an experiment, I wrote a simple web server on GO (+ martini simply because the example for heroku was with this library, you can use your own or any other one)
Various requests are made to the server and statistics are displayed on the main page. To update the data, I inserted an auto-reload tag into the header: How to do this more accurately, without reloading everything? All statistics are just text, no graphics, nothing.
<meta http-equiv="refresh" content="3" />

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GavriKos, 2019-03-06
@GavriKos

The web server has nothing to do with it at all.
Make a request on the page with Ajax and that's it.

D
devalone, 2019-03-06
@devalone

web sockets

G
grinat, 2019-03-06
@grinat

You can stupidly insert an iframe into it and a page with<meta http-equiv="refresh" content="3" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question