Updating a picture without page reload

前端 未结 6 2028
广开言路
广开言路 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:24

    every X seconds send Ajax to server. if link of image from response == previous, no update, if link new: $('img.class').attr('src','link');

提交回复
热议问题