Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-21292] Do not attempt to parse blank responses from cancelle…
…d 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.
(cherry picked from commit 72bb477)
  • Loading branch information
nzmsv authored and olivergondza committed Feb 16, 2014
1 parent 53e2f7e commit 4ea919c
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -59,10 +59,12 @@ THE SOFTWARE.
method:"POST",
parameters: {min: i*interval, max:(i+1)*interval},
onSuccess: function(t) {
try {
eventSource1.loadJSON(eval('('+t.responseText+')'),'.');
} catch (e) {
alert(e);
if (t.status != 0) {
try {
eventSource1.loadJSON(eval('('+t.responseText+')'),'.');
} catch (e) {
alert(e);
}
}
}
});
Expand Down

0 comments on commit 4ea919c

Please sign in to comment.