以下代码应该在页面加载后执行AJAX请求,然后在弹出窗口中显示该AJAX调用的响应。这在Firefox中起作用,但我不知道为什么它在IE8中不起作用。Prototype的Ajax.Request和Internet Explorer 8
<html>
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript">
// Do this stuff when DOM finishes loading.
document.observe("dom:loaded", function() {
new Ajax.Request("page.html", {
onSuccess: function(response) {
alert(response.responseText);
}
});
});
</script>
</head>
<body>
</body>
</html>
page.html中只包含
hello world
我失去了一些东西明显或这是原型JS库不是与IE8完全兼容的结果?我用最新的稳定原型版本(1.6.0.3)和最新版本(1.6.1 RC3)尝试了这个版本,但没有运气。任何帮助将不胜感激,谢谢!
这就是问题所在,非常感谢 – Matthew 2009-07-14 16:36:54