跆拳道IE7 - AJAX使用的setTimeout调用 [英] Wtf IE7 - AJAX calls using setTimeout

查看:131
本文介绍了跆拳道IE7 - AJAX使用的setTimeout调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Firefox,Opera和Seamonkey的测试这一点。它工作正常。当涉及到Internet Explorer 7,它的工作原理,但高达某一点。我想提出一个AJAX调用PHP脚本每隔几秒钟。在IE7它使第一次的AJAX调用,并获取数据,但它不会再这样做永远。尽管我在别的块中的setTimeout函数。 为什么:?(

I have tested this on Firefox, Opera and Seamonkey. It works fine. When it comes to Internet Explorer 7. It works but upto a certain point. I am making an AJAX call to a PHP script every few seconds. In IE7 it makes the first AJAX call and it retrieves the data but it doesn't do it again ever. Even though i have a setTimeout function in the else block. WHY? :(

startTime = setTimeout('getStatus()', 5000); 

}//function convertNow

的getStatus函数() {

function getStatus() {

	$.ajax({
	type: "GET",
	url: "fileReader.php",
	data: 'textFile=' + fileNameTxt,
	success: function(respomse){
	textFileResponse = respomse.split(" ");
	$("#done").html("Downloading & Converting Video...<b style='font-size:17px;color:green;'>" + textFileResponse[0] + "</b><br /><b>" + properFileName + '</b>');
	}
	});//ajax

	if(textFileResponse[0]=='100.0%'){

	}
	else{		
	continueTime = setTimeout('getStatus();', 3000); 
		alert('call end');
	}

}

道歉,如果遇到挫折来通过这个问题。我一直在跑来跑去像无头鸡近3个小时。

Apologies if any frustration comes through this question. I've been running around like a headless chicken for the past 3 hours.

感谢您的任何帮助。

我添加了全功能。该setTimeout的似乎是正常工作。它必须是AJAX调用,我只是检查什么被退回。更奇怪的!它不断从AJAX请求返回相同的值,并将其没有得到任何新的价值!我想答案2可能有something.It可能是由于与缓存,但你怎么过过来的?

I have added the full function. The setTimeout seems to be working correctly. It must be the AJAX call, am just checking what is being returned. Even stranger! It keeps returning the same value from the AJAX request and its not getting any newer values!! I think Answer 2 might have something.It may be due with cache but how do you over come that?

推荐答案

您请求通过HTTP GET Ajax调用,而不是HTTP POST? IE倾向于使用AJAX调用缓存结果,除非使用POST而非GET。

Are you requesting the ajax call via HTTP GET as opposed to HTTP POST? IE tends to use cached results of ajax calls unless you use POST instead of GET.

编辑:既然你已经更新了你的问题,我可以看到你的确使用GET动词。将其更改为POST,我敢打赌,你的问题将得到解决。

Since you've updated your question, I can see that you are indeed using the GET verb. Change it to POST and I bet your issue will be resolved.

这篇关于跆拳道IE7 - AJAX使用的setTimeout调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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