Update to latest jsonld.js.
--- a/playground/jsonld.js Mon Mar 03 16:10:21 2014 -0500
+++ b/playground/jsonld.js Mon Mar 03 16:21:42 2014 -0500
@@ -1502,6 +1502,16 @@
var xhr = options.xhr || XMLHttpRequest;
var req = new xhr();
req.onload = function(e) {
+ if(req.status >= 400) {
+ return callback(new JsonLdError(
+ 'URL could not be dereferenced: ' + req.statusText,
+ 'jsonld.LoadDocumentError', {
+ code: 'loading document failed',
+ url: url,
+ httpStatusCode: req.status
+ }), {contextUrl: null, documentUrl: url, document: null});
+ }
+
var doc = {contextUrl: null, documentUrl: url, document: req.response};
// handle Link Header (avoid unsafe header warning by existence testing)