javascript - Knockout.js: Changing the value of Observable does not change the value of attribute in html -


I have a fairly simple file that provides a pencil image like this:

  Define ['durandal / events', 'knockout'], function (events, to) {var pensilm = function} (this.pencilimagepath = ko.observable ("img / pencil.png");}; return pencilVM; });   

and one html:

   & Lt; / Div & gt;   

Now when I change the name of the image from the pencil page on some IMG page, the last HTML in the browser has not been updated. This image stays in the form of a "pencil page"

I think the browser is caching the image is.

Just add a timestamp to your new image source

  var d = new date (); This.pencilimagepath ("img / someImg.png" + d.getTime ());   

Hope that helps.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -