prototype.js 1.6.0.3 Ajax.Updater not working in I

2019-04-17 14:20发布

This works on all other browsers...but fails on IE7 & IE8. Help Please!

<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script src="/javascripts/prototype.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<input type="button" value="Ajax Test" onclick="var myAjax = new Ajax.Updater('TestContent', '/store/home', {method: 'post', parameters: 'foo=bar'});" />
<div id="TestContent" style="margin: 100px; border: 1px solid #F00; height: 500px;">
</div>
</body>
</html>

3条回答
▲ chillily
2楼-- · 2019-04-17 14:25

Syntax looks ok. Maybe the variable assignment isnt allowed or causing the variable to be deleted before its complete. Have you tried with creating the Updater in an external function?

查看更多
孤傲高冷的网名
3楼-- · 2019-04-17 14:30

removed all utf-8 references and suddenly IE decides to play ball. IE, even the brand new version 8, is years behind the other 3 (Firefox, Safari, Opera)... oh well.

查看更多
一夜七次
4楼-- · 2019-04-17 14:37

I had a similar problem.

It turns out that in my case, the ajax response had a FORM element in it, and the destination of the updater was already inside a FORM element.

It worked fine in firefox, but not IE.

link text

查看更多
登录 后发表回答