循环同步Ajax xmlhttp请求不在IE中刷新 [英] Looping synchronous Ajax xmlhttp requests not refreshing in IE

查看:75
本文介绍了循环同步Ajax xmlhttp请求不在IE中刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个循环,我正在制作Ajax xmlhttp请求。这发生在由window.onload事件触发的函数中。


使用async = false进行Ajax调用,因为它们需要按照依赖于每个步骤的特定顺序进行在下一次发生之前完成。


循环中的每个连续请求,我都在用xmlhttp.responseText更新一个div。


Firefox根据需要在通话之间刷新。


IE不是。循环开始时,div将填充预循环内容。当循环结束时,div将填充在循环外发生的第一次刷新。


有人可以帮忙吗?


两个尝试的解决方案:

1.在GET查询字符串的末尾添加一个随机字符串以确保唯一的URL

2.使用POST方法提交


两者都没有运气。


谢谢。

Hi,

I have a loop in which I''m making Ajax xmlhttp requests. This occurs within a function triggered by a window.onload event.

The Ajax calls are being made with async=false, because they need to occur in a specific order that relies on each step completing before the next can occur.

With each successive request in the loop, I''m updating a div with the xmlhttp.responseText.

Firefox is refreshing between calls as desired.

IE is not. When the loop begins, the div is populated with the pre-loop content. When the loop finishes, the div is populated with the first refresh that occurs outside of the loop.

Can someone please help?

Two attempted solutions:
1. Adding a random string to the end of the GET query string to ensure a unique url
2. Submitting with the POST method

No luck with either.

Thanks.

推荐答案

我需要查看代码不仅仅是猜测。
I would need to see the code to make more than a guess.


展开 | 选择 | Wrap | 行号


好吧,for ... in循环不适合循环数组,更好地使用标准for()循环。
well, a for … in loop is not the suited structure to loop over an array, better use a standard for() loop.


这篇关于循环同步Ajax xmlhttp请求不在IE中刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆