Welcome to WebmasterWorld Guest from 23.22.140.143

Forum Moderators: open

Message Too Old, No Replies

JQuery AJAX only loading once in IE

     
4:23 pm on Oct 20, 2011 (gmt 0)

New User

10+ Year Member

joined:Dec 9, 2005
posts: 29
votes: 0


I am having an issue with the following code only loading once in IE, it loads fine repeatedly in Chrome, FF, and safari. If anyone has any suggestions I would greatly appreciate it:


<script type="text/javascript">
var c=0;

setInterval(function() {
$.ajax({
type: "GET",
url: 'randomize.php',
success: function(data) {
$('#dispeople').html(data);
}
});
},2000);


</script>
4:55 pm on Oct 20, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts:4966
votes: 10


You're probably getting a cached version in IE. Add some dynamic value to the URL to prevent it from caching.

url: 'randomize.php?ck=' + (new Date()).getTime(),
6:38 pm on Oct 20, 2011 (gmt 0)

New User

10+ Year Member

joined:Dec 9, 2005
posts: 29
votes: 0


Thanks for the suggestion, i tried that along with adding this above the JQuery:

$.ajaxSetup ({
// Disable caching of AJAX responses
cache: false
});

and am still experiencing the same issue, any other thoughts?
6:38 pm on Oct 20, 2011 (gmt 0)

New User

10+ Year Member

joined:Dec 9, 2005
posts: 29
votes: 0


So now i have this for the entire code block:

<script type="text/javascript">
var c=0;

$.ajaxSetup ({
// Disable caching of AJAX responses
cache: false
});

setInterval(function() {
$.ajax({
type: "GET",
url: 'randomize.php?ck=' + (new Date()).getTime(),
success: function(data) {
// data is ur summary
$('#dispeople').html(data);
}
});
},2000);


</script>
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members