H
H
Hellas2017-01-08 09:50:01
JavaScript
Hellas, 2017-01-08 09:50:01

Is it possible to send data from the server to the client to a specific url?

Let's say we're uploading an image to a page located at a specific url.
We send data to the server using $.ajax POST, the image changes to the uploaded one.
Is it possible to send new image data to everyone on this page without reloading it?
And without using sockets.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Deodatuss, 2017-01-08
@Deodatuss

well, if the religion does not allow web sockets, then only long polling (well, or torture the server with a timer, but this is already hell)

R
rPman, 2017-01-08
@rPman

websocket was created exactly for this,
and before that, delayed longpool http requests with a pause were used (the server keeps the connection open with the client, which makes a request like 'is there anything for me', until you need to send him a message, and so on in a loop )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question