I usually insert html+scripts returned from ajax request to the document using jQuery html() method, which also executes the scripts.
Means that if I write:
$(document.body).html("<script>alert()</"+"script>");
it will execute the script.
(the + is only for the browesr, since writing </script> in a string does not work.)
The problem - if I do the same for a new opened window, it does not work. i.e. the scripts are not executed. why?