From cb9222a20c2558fc0ef60d3b18880d1fe15af70d Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 12 Mar 2014 14:07:35 +0000 Subject: [PATCH] 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 --- src/www/js/support.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ----------------------------------------------------- */