diff --git a/source/Ox.UI/js/Core/Request.js b/source/Ox.UI/js/Core/Request.js index 12e2401a..fd837f1d 100644 --- a/source/Ox.UI/js/Core/Request.js +++ b/source/Ox.UI/js/Core/Request.js @@ -106,7 +106,8 @@ Ox.Request = (function() { @*/ send: function(options) { - var options = Ox.extend({ + var data, + options = Ox.extend({ age: -1, callback: null, id: Ox.uid(), @@ -122,7 +123,7 @@ Ox.Request = (function() { if (pending[options.id]) { setTimeout(function() { Ox.Request.send(options); - }, 0); + }); } else { requests[options.id] = { url: options.url, @@ -132,8 +133,9 @@ Ox.Request = (function() { options.age == -1 || options.age > +new Date() - cache[req].time )) { + data = cache[req].data; setTimeout(function() { - callback(cache[req].data, true); + callback(data, true); }); } else { pending[options.id] = true;