提交 72bb4773 编写于 作者: G Greg Inozemtsev

Do not attempt to parse blank responses from cancelled XHR POST requests

An XHR POST request may be cancelled by navigating away from the page while the timeline is loading.  This causes alert spam on Chrome and Safari.
上级 5b40b8de
...@@ -59,10 +59,12 @@ THE SOFTWARE. ...@@ -59,10 +59,12 @@ THE SOFTWARE.
method:"POST", method:"POST",
parameters: {min: i*interval, max:(i+1)*interval}, parameters: {min: i*interval, max:(i+1)*interval},
onSuccess: function(t) { onSuccess: function(t) {
try { if (t.status != 0) {
eventSource1.loadJSON(eval('('+t.responseText+')'),'.'); try {
} catch (e) { eventSource1.loadJSON(eval('('+t.responseText+')'),'.');
alert(e); } catch (e) {
alert(e);
}
} }
} }
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册