+ // OK, so it turns out that ajax "json" format - or for that matter, any
+ // format for json is still just text. There is no point in getting this
+ // using special jQuery "json" formats. Duh. BH wasted a whole day try to
+ // "do it right".
+ response = Platform.getFileAsString(url.toString());
+ responseCode = (response == null || response == "" ? 404 : 200);
+ isJSON = encoding[0].equals("application/json");
+ if (isJSON)
+ {
+ try
+ {
+ jsonData = JSON.parse(response);
+ } catch (Exception e)
+ {
+ jsonData = null;
+ }
+ if (jsonData == null)
+ {
+ responseCode = 400;
+ }
+ }