diff --git a/jquery.embedly.js b/jquery.embedly.js index f445b38..27f6672 100644 --- a/jquery.embedly.js +++ b/jquery.embedly.js @@ -11,6 +11,7 @@ // Defaults for Embedly. var defaults = { + domain: 'api.embed.ly', key: null, endpoint: 'oembed', // default endpoint is oembed (preview and objectify available too) secure: null, // use https endpoint vs http @@ -134,7 +135,7 @@ } var base = (secure ? 'https': 'http') + - '://api.embed.ly/' + (method === 'objectify' ? '2/' : '1/') + method; + '://' + options.domain + '/' + (method === 'objectify' ? '2/' : '1/') + method; // Base Query; var query = none(options.query) ? {} : options.query; @@ -194,12 +195,11 @@ // Put everything into batches, even if these is only one. var batches = batch(valid_urls, options.batch), self = this; - // Actually make those calls. - $.each(batches, function(i, batch){ + $.each(batches, function(i, batch) { $.ajax({ url: self.build(method, batch, options), - dataType: 'jsonp', + cache: true, success: function(data){ // We zip together the urls and the data so we have the original_url $.each(zip([batch, data]), function(i, obj){ diff --git a/src/jquery.embedly.js b/src/jquery.embedly.js index 86adcbf..fe6d83f 100644 --- a/src/jquery.embedly.js +++ b/src/jquery.embedly.js @@ -8,6 +8,7 @@ // Defaults for Embedly. var defaults = { + domain: 'api.embed.ly', key: null, endpoint: 'oembed', // default endpoint is oembed (preview and objectify available too) secure: null, // use https endpoint vs http @@ -131,7 +132,7 @@ } var base = (secure ? 'https': 'http') + - '://api.embed.ly/' + (method === 'objectify' ? '2/' : '1/') + method; + '://' + options.domain + '/' + (method === 'objectify' ? '2/' : '1/') + method; // Base Query; var query = none(options.query) ? {} : options.query; @@ -191,12 +192,11 @@ // Put everything into batches, even if these is only one. var batches = batch(valid_urls, options.batch), self = this; - // Actually make those calls. - $.each(batches, function(i, batch){ + $.each(batches, function(i, batch) { $.ajax({ url: self.build(method, batch, options), - dataType: 'jsonp', + cache: true, success: function(data){ // We zip together the urls and the data so we have the original_url $.each(zip([batch, data]), function(i, obj){