homepage Welcome to WebmasterWorld Guest from 23.23.8.131
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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

5+ Year Member



 
Msg#: 4377146 posted 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

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4377146 posted 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

5+ Year Member



 
Msg#: 4377146 posted 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

5+ Year Member



 
Msg#: 4377146 posted 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved