1
帮助,我需要改变这个代码来支持远程域的访问:在你返回JS转换XMLHttpRequest来JSONP
function goRemote(url) {
var script = document.createElement("script");
script.src=url;
document.body.appendChild(script);
}
function parseDate(json) {
// do your fun here.
}
:在你的js
document.write(url);
var http = getHTTPObject();
http.open("GET", url, true);
http.onreadystatechange = function() {
if (http.readyState == 4) {
parseData(http.responseText);
}
}
http.send(null);
实际上,HEAD标签在HTML4.01中不能具有“id”属性。相反,使标记无效并通过ID访问HEAD元素,请使用'getElementsByTagName('head')[0]'(或任何类型的可用选择器实用程序,如jQuery中的''',Prototype.js中的$$'等) – kangax 2009-08-20 13:26:41
返回的js样本无效.. – Tom 2009-08-20 13:28:19
获取元素头不工作.. – Tom 2009-08-20 13:32:48