I have just finished my first AJAX request and got it working in Google, Safari Firefox ETC. It is very basic and just calls a PHP query with a random result and shows this inside a DIV. I then tested it in IE10 and the AJAX does not work. When i refresh teh page i get a new result but it does not refresh after 3 seconds. This is the code
$(function() {
getStatus();
});
function getStatus() {
$('div#status').load('thankyou.php')
setTimeout("getStatus()",3000);
setTimeout(function(){$("getstatus").html(getStatus)},3000);
}
I have looked for answers and got
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >
between my head and head. It cured another issue i was having with a jquery rotator but not the AJAX. Is it my code or IE10? and any known soulutions?
Thanks to Crush and DownMaster i looked at the problem in a different way. By preventing the AJAX page being cached seems to makes it work, adding $.ajaxSetup({cache: false});
prevents the cache.
$(function() {
getStatus();
});
function getStatus() {
$.ajaxSetup({ cache: false });//prevents the AJAX cache.
$('div#status').load('thankyou.php')
setTimeout("getStatus()",3000);
setTimeout(function(){$("getstatus").html(getStatus)},3000);
}