【发布时间】:2012-08-29 09:43:28
【问题描述】:
是否可以更改此代码,因此如果 http://www.myurl.com 重定向到应该运行的 js 文件,它将递归工作?
function include(scriptUrl)
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", scriptUrl);
xmlhttp.onreadystatechange = function()
{
if ((xmlhttp.status == 200) && (xmlhttp.readyState == 4))
{
eval(xmlhttp.responseText);
}
};
xmlhttp.send();
}
include("http://www.myurl.com");
【问题讨论】:
-
不,这是自动完成的,见stackoverflow.com/q/282429/1048572
标签: javascript ajax scripting download