0 Replies Latest reply on Aug 16, 2010 6:15 PM by lovewebdev

    Create a twitter like stream of records

    lovewebdev Level 1

      I use a call like the one below to retrieve database records. I use set interval to get a stream of new records as they come in.


      The problem I have is that it all gets placed into one <span id="bodyresults"></span>


      So everytime it refreshes ALL the records refresh. I would like new records to come in overtop the old records like a twitter stream.


      Can anyone give me a headstart.


      <script language="javascript" type="text/javascript">
      //Browser Support Code
      function ajaxFunctioni(sid, ltid){
          var ajaxRequest;  // The variable that makes Ajax possible!
              // Opera 8.0+, Firefox, Safari
              ajaxRequest = new XMLHttpRequest();
          } catch (e){
              // Internet Explorer Browsers
                  ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
              } catch (e) {
                      ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                  } catch (e){
                      // Something went wrong
                      alert("Your browser broke!");
                      return false;
          // Create a function that will receive data sent from the server
          ajaxRequest.onreadystatechange = function(){
              var queryString = "?sid=" + sid + "&ltid=" + ltid;


      ajaxRequest.open("GET","ajaxget.asp" + queryString, true);
                  document.getElementById('bodyresults' + sid).innerHTML = "";