If i try yo use WebMethod to return an HTML code that contains a script reference like
<script src="js/components/MyJS.js" id="testScript" type="text/javascript"></script>
All the content returned using HTML i bind it to a span.
Problem:
This script does not get executed in Safari but all other.
I try to hard code the entire html then it get executed but not if i get the complete html as a string using AJAX and then bind it to some html tag.
Code for getting html:
var control = this;
$.ajax({
type: "POST",
url: opts.url,
data: "{control_name : '" + opts.control_name + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("Error occured textStatus=" + textStatus + " errorThrown=" + errorThrown);
},
success: function (msg) {
control.html(msg.d);
}
});
Any help is appreciated.
The bug is because of Jquery library.
If i try to use minified version it does not work but full version work. It seems too be strange.