summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-03-12 14:07:35 +0000
committerhallgren <hallgren@chalmers.se>2014-03-12 14:07:35 +0000
commitca8dd1e8cc7c24abffac758f9eb1601bb3afb65a (patch)
tree188d84a6711fb0524a32314afbeebdcd667f8bfd
parentf092e7fe5bf26253c7edbf12d86188642a40ac2d (diff)
support.js: For better error handling, always use AJAX, don't fallback to JSONP
Cross-origin requests are allowed by the PGF service and are supported in all modern browsers. See http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
-rw-r--r--src/www/js/support.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/www/js/support.js b/src/www/js/support.js
index 27207ac2e..934ea0f96 100644
--- a/src/www/js/support.js
+++ b/src/www/js/support.js
@@ -140,11 +140,21 @@ function sameOrigin(url) {
return hasPrefix(a.href,location.protocol+"//"+location.host+"/");
}
+/*
// Use AJAX when possible, fallback to JSONP
function http_get_json(url,cont,errorcallback) {
if(sameOrigin(url)) ajax_http_get_json(url,cont,errorcallback);
else jsonpf(url,cont,errorcallback);
}
+*/
+
+// For better error handling, always use AJAX, don't fallback to JSONP
+// Cross-origin requests are allowed by the PGF service and are supported in
+// all modern browsers.
+// See http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
+function http_get_json(url,cont,errorcallback) {
+ ajax_http_get_json(url,cont,errorcallback);
+}
/* --- URL construction ----------------------------------------------------- */