I got this JavaScript code on my webpage:
var dLastUpdate = new Date;
var getData = function () {
alert(dLastUpdate);
$.post("mypage.aspx?accion=getData", {}, function (data) {RefreshData(data)})
}
function RefreshData(rValue) {
dLastUpdate = rValue.UpdateTime;
}
getData function it's called many times. In theory, dLastUpdate should be empty the first call, and save the value returned from server. Never the less, in the alert(dLastUpdate); the variable already have value on the first call (page load).
How can this be posible?
Could be that the client is caching the value from previous run? Thanks!