I am trying to upload an image from the server (same name, but always a new image) in the html tag: #webCamStageImage. While I can upload the image, but the browser does not show me the new image - I think this is a caching problem, because when I turn on "disable WebCore cache" in Safari, it works.
Here is my code:
setInterval(function() { $("#webCamStageImage").attr({'src': "http://picture.jpg"}); }, 5000);
How to change / ddelte / refresh old image?
Chris
Try using a URL with a hopeless query string:
setInterval(function() { $("#webCamStageImage").attr({'src': "http://picture.jpg?foo=" + new Date().getTime()}); }, 5000);
URL , , , , - ( ). ( ...).
, :
var randNum = Math.floor(Math.random() 999 + 1); setInterval(function() { $("#webCamStageImage").attr({'src': "http://picture.jpg?rand=" + randNum}); }, 5000);
Source: https://habr.com/ru/post/1755121/More articles:Multiple instances of a canvas user control throw an exception in Silverlight - c #Как я могу исправить флеш-флагом PHP-потокобезопасное/непоточное безопасное рассогласование? - phpWhat is the difference between Partial and Slot in Symfony? - symfony1AnsiStrIComp не сравнивает строки в Delphi 2010 - stringFade / Redraw / Modify ImageIcon when clicking on SWING JLabel on the fly - javaPython Regex (finding multiple values on a single line) - pythonНовый HttpSession для каждого запроса? - javaHow to convert hash information on torrents for cleaning? - phpChanging the default display of DateTime in the Visual Studio Viewer - .netTwo short questions about std :: vector - c ++All Articles