如果要对具有html内容的Javascript标签进行评估,则应将ajax调用的dataType选项设置为“ html”:
$.ajax({ type: "GET", url: "yourPage.htm", dataType: "html"});或者,如果要加载并执行.js文件,则为dataType“ script”:
$.ajax({ type: "GET", url: "test.js", dataType: "script"});更多信息在这里:Ajax / jQuery.ajax



