Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Thu, 17 Apr 2014 12:38:41 -0400
changeset 2146 e8980b354e4a
parent 2145 f126733e13cf
child 2147 e5b6e8068cce
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Tue Apr 15 23:44:01 2014 -0400
+++ b/playground/jsonld.js	Thu Apr 17 12:38:41 2014 -0400
@@ -792,7 +792,6 @@
  *            (default: false).
  *          [useNativeTypes] true to convert XSD types into native types
  *            (boolean, integer, double), false not to (default: false).
- *
  * @param callback(err, output) called once the operation completes.
  */
 jsonld.fromRDF = function(dataset, options, callback) {
@@ -831,9 +830,9 @@
       // check supported formats
       rdfParser = options.rdfParser || _rdfParsers[options.format];
       if(!rdfParser) {
-        throw new JsonLdError(
+        return callback(new JsonLdError(
           'Unknown input format.',
-          'jsonld.UnknownFormat', {format: options.format});
+          'jsonld.UnknownFormat', {format: options.format}));
       }
     }
     else {
@@ -1299,6 +1298,9 @@
     }
     $.ajax({
       url: url,
+      accepts: {
+        json: 'application/ld+json'
+      },
       dataType: 'json',
       crossDomain: true,
       success: function(data, textStatus, jqXHR) {