【发布时间】:2011-08-16 06:00:54
【问题描述】:
我来自俄罗斯,很抱歉我的英语不好。
我想通过js加载我网站的主页,我使用这个脚本:
<script type="text/javascript">
function httpGet(theUrl) {
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send(null);
return xmlHttp.responseText;
}
alert(httpGet('http://site.ru'));
</script>
脚本位于 site.ru/page123。
它可以在 Firefox 中运行并真正提醒我的主页,但如果我在 Opera 中运行它,则什么也没有发生。请修复我的代码,我看不到任何错误。提前致谢。
【问题讨论】:
标签: javascript ajax xmlhttprequest opera