Jquery Internet Explorer 8 compatibility issue, does not load data unless history is deleted...

Posted by Scarface on Stack Overflow See other posts from Stack Overflow or by Scarface
Published on 2010-03-25T01:56:44Z Indexed on 2010/03/25 2:03 UTC
Read the original article Hit count: 411

Filed under:

Hey guys, I have a weird problem. I have an update system that refreshes data on a time interval. It works well in all browsers except internet explorer 8. The problem is that once it loads the data, it does not matter if the data updates further, it will not update the data visually until the internet history is cleared. I am not using any cookies server-side...Anyone ever encounter something like this?

Here is my javascript, thanks for any assistance in advance

function prepare(response) {
          var d = new Date();
          count++;
          d.setTime(response.time*1000);

          var mytime = d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();
          var string = '<li class="shoutbox-list" id="list-'+count+'">'
              + '<span class="shoutbox-list-nick"><a href="statistics.php?user='+response.user+'">'+response.user+'</a></span>'
              + ' <span class="date">'+mytime+'</span><br>'
              + '<span class="msg">'+response.message+'</span>'
              +'</li>';

          return string;
        }
 function refresh() {
          $.getJSON(files+"shoutbox.php?action=view&time="+lastTime+"&topic_id="+topic_id, function(json) {
            if(json.length) {
              for(i=0; i < json.length; i++) {
                $('#daddy-shoutbox-list').prepend(prepare(json[i]));
                $('#list-' + count).fadeIn(1500);
              }
              var j = i-1;
              lastTime = json[j].time;
            }
            //alert(lastTime);
          });
          timeoutID = setTimeout(refresh, 3000);
        }
       $(document).ready(function() {

            var options = { 
              dataType:       'json',
              beforeSubmit:   validate,
              success:        function(response, status){
                  if (response.error=='success'){
                     success(response, status);
                  }
                  else {
                      $.prompt(response.error);
                  }
              }
            }; 
            $('#daddy-shoutbox-form').ajaxForm(options);
            timeoutID = setTimeout(refresh, 100);


        });

© Stack Overflow or respective owner

Related posts about jQuery