When I use JQuery ajax function and the response is quite large ~1mb the ui gets frozen just before the success function is called. I have experienced this with the JSON.parse function and parsing a large amount of data. I believe that this function is used on the return of the request to format the content into JSON. Here is the code I am using.
$.ajax({
url: "/sessions/" + this.get("session_id") + "/get_sample_data",
data: params,
dataType: 'json',
type: "GET",
success: function (response) {
success(response);
}
});
Is there anyway to override the code for the response so I can stagger the parsing into parts and hopefully minimise the blocking on the ui? or is there another way to fix this. I am using chrome and chrome canary and I get the same result in both.
Thanks in advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…