diff --git a/app/assets/javascripts/discourse/components/onebox.js b/app/assets/javascripts/discourse/components/onebox.js index eb7a1bf7b7f..a4ac43c9f6d 100644 --- a/app/assets/javascripts/discourse/components/onebox.js +++ b/app/assets/javascripts/discourse/components/onebox.js @@ -49,7 +49,10 @@ Discourse.Onebox = { $elem.addClass('loading-onebox'); // Retrieve the onebox - var promise = Discourse.ajax("/onebox", { data: { url: url, refresh: refresh } }); + var promise = Discourse.ajax("/onebox", { + dataType: 'html', + data: { url: url, refresh: refresh } + }); // We can call this when loading is complete var loadingFinished = function() { diff --git a/app/assets/javascripts/discourse/controllers/composer_controller.js b/app/assets/javascripts/discourse/controllers/composer_controller.js index 0b370d20e9f..e25420d025c 100644 --- a/app/assets/javascripts/discourse/controllers/composer_controller.js +++ b/app/assets/javascripts/discourse/controllers/composer_controller.js @@ -132,8 +132,8 @@ Discourse.ComposerController = Discourse.Controller.extend({ // If visible update the text var educationKey = this.get('content.creatingTopic') ? 'new-topic' : 'new-reply'; var composerController = this; - Discourse.ajax("/education/" + educationKey).then(function(result) { - composerController.set('educationContents', result.responseText); + Discourse.ajax("/education/" + educationKey, {dataType: 'html'}).then(function(result) { + composerController.set('educationContents', result); }); }.observes('typedReply', 'content.creatingTopic', 'Discourse.currentUser.reply_count'),