summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-06-08 18:55:23 +0000
committerSarven Capadisli <csarven@controlyourself.ca>2009-06-08 18:55:23 +0000
commita2ca9d96d202d2acd4210fceec1a394f82f635ce (patch)
tree48bacbd7145e18dd2720327337dea2f299f78fb5 /js/util.js
parent265e2bd58de2a01e0d7840310eb44b21b70e3914 (diff)
Temporary workaround for silenting mysterious 200 OK error for XHR
notice posts. The bug is sometimes reproduceable by sending a notice that includes "@someusernamethatdoesntexist". This patch doesn't throw alerts to user if server doesn't return with an XHR response but HTTP is one of 20x, 30x.
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/util.js b/js/util.js
index 3f14bc61c..763c7d7ee 100644
--- a/js/util.js
+++ b/js/util.js
@@ -178,7 +178,10 @@ $(document).ready(function(){
$('#form_notice').append(document._importNode($(".error", xhr.responseXML).get(0), true));
}
else {
- alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again.");
+ var HTTP20x30x = new Array(200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 305, 306, 307);
+ if(jQuery.inArray(parseInt(xhr.status), HTTP20x30x) < 0) {
+ alert("Sorry! We had trouble sending your notice ("+xhr.status+" "+xhr.statusText+"). Please report the problem to the site administrator if this happens again.");
+ }
}
}
},