I need to replace the content of a div in my page with the html resultant from an ajax call. The problem is that the html have some necessary scripts in it and it seems that
This is the easiest solution:
var keepScripts; keepScripts = true; $.parseHTML(yourHtmlString, keepScripts);
This will keep the script tags in ;)