开发者

jquery ajax requests increase of memory

I have an ajax request every 1 second that pulls a JSON from server and manipulate a div. After a while, browser shows a large memory use in task manager about 200, 30开发者_如何学编程0, 500 MB and its still growing. How can I replace new data with old without caching or anything that affect memory?


Try nulling out the existing JSON file before each request, and be sure its writing to the same variable. Is this happening inside a loop? Move the variable outside of the loop and refer to it instead.


Try using cache: false:

$.ajax({
url: "test.html",
cache: false,
success: function(html){
$("#results").append(html);
}
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜