$.ajax({ type: "GET", dataType: 'html', contentType: 'application/x-www-form-urlencoded', url: '/url', success: function (data) { //have to replace script or else jQuery will remove them var parsedHTML = data.replace(/script/gi, 'rickscript'); $(parsedHTML).find('rickscript').each(function (index, domEle) { if (!$(this).attr('src')) { eval($(this).text()); //feeling lucky execute it } }); } });
↧
How to get script tags with jQuery .find from ajax result
↧