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