jQuery .load() / .ajax() not executing javascript in returned HTML after appended
I've tried using .load() and $.ajax to get some HTML that needs to be appended to a container, but the Javascript within the returned HTML is not being executed when I append it to an element. Using .load() : $('#new_content').load(url+' #content > *',function() { alert('returned'); }); I've also tried switching to a $.ajax call. I then extracted the script from the returned HTML after which I appended it to the container, but same problem, the JS isn't being executed or even appended in this case, and as I understand it, trying to append a <script> to a DOM element like this is frowned upon?