I have content that I load dynamicaly with jquery. The content is HTML with a script tag in it.
So I have something like this.
var content = '<script language="javascript" type="text/javascript">alert("test");</script><div>mydiv</div>';
I want to create a new div with this content with jquery
var dialog = $('<div class="modal-popup">' + content + '</div>');
But in the new created div (dialog) there is no script tag.
In the past it worked. We updated jquery from 1.5.1 to 1.7.1. I already dowdated jquery, with the same result.
We use ist to create a print dialog and we recognized, that we can not print anymore. I am browsing through the repository, but can not find a change we have made.
What is the reason, the the script-tag is gone?
EDIT: It depends on the JQuery release. In v1.5.1 it works, in v1.7.2 not.
The reason, that it does not work in my prior test with v1.5.1 was, that the browser cached jquery for some reasons
EDIT 2: In this example content is a string variable to keep it simple. In real environment content is filled by $.get and is an HTML-Document with javascript in it.