Updating a picture without page reload

前端 未结 6 2032
广开言路
广开言路 2020-12-16 20:41

How would I go about updating an image that gets updated on a server every couple of seconds with out the user having to hit the refresh button, my first guess was ajax but

6条回答
  •  感动是毒
    2020-12-16 21:31

    It seems there is something wrong with your Perl script. Trying to access the image by the URL should return an image anyway. It should return binary data and not a script. You should also set the Content-type header of the response to image/gif. Verify if it indeed returns binary data before trying to fix your JavaScript code.

提交回复
热议问题