jQuery.ajax({url: "/quiz_widget/846/"}).done(function(data) { $('script[src="/quiz_embed/846/"]').after(data); });