homepage Welcome to WebmasterWorld Guest from 54.196.206.80
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
JQuery AJAX only loading once in IE
tsisson




msg:4377148
 4:23 pm on Oct 20, 2011 (gmt 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>

 

Fotiman




msg:4377162
 4:55 pm on Oct 20, 2011 (gmt 0)

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(),

tsisson




msg:4377247
 6:38 pm on Oct 20, 2011 (gmt 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?

tsisson




msg:4377249
 6:38 pm on Oct 20, 2011 (gmt 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>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved