dsg435665475 2009-04-14 20:58
浏览 32
已采纳

Prototype的Ajax.Updater实际上没有在IE7上更新

I am trying to submit a form using Ajax.Updater and have the result of that update a div element in my page.

Everything works great in IE6, FF3, Chrome and Opera. However, In IE7 it sporadically works, but more often than not, it just doesn't seem to do anything.

Here's the javascript:

function testcaseHistoryUpdate(testcase, form) {
document.body.style.cursor = 'wait';
var param = Form.serialize(form);
new Ajax.Updater("content", "results/testcaseHistory/" + testcase, {
    onComplete: function(transport) {document.body.style.cursor = 'auto'}, 
    parameters: param,
    method: 'post'
    }
);
}

I've verified using alert() calls that param is set to what I expect.

I've read in many places that IE7 caches aggressively and that it might be the root cause, however every after adding the following to my php response, it still doesn't work.

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

To further try to fix a caching issue I've tried adding a bogus parameter which just gets filled with a random value to have different parameters for every call, but that didn't help.

I've also found this, where UTF-8 seemed to be causing an issue with IE7, but my page is clearly marked:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Does anyone have any idea what could be wrong with IE7 as opposed to the other browsers I tested to cause this kind of issue?

  • 写回答

6条回答 默认 最新

  • dsfo22654 2009-05-26 21:38
    关注

    It appears that you cannot do an update on a DOM id element that is inside a form tag in ie. Has anyone found a way around this? My code works fine when I move it outside the form tag, and also when I just comment out the form tag and don't move the DOM element.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看