Posted by AFNedreN Wed 7th Mar 2007 21:17 - Syntax is None/text - 265 views
Download | New Post | Modify | Show line numbers
   var xmlHttp;
   function checkPosts() {
      xmlHttp = createRequestObject();
      if (xmlHttp == null) {
         alert('Sorry, your browser does not support xml HTTP requests.');
         return false;
      }
      xmlHttp.open('POST', '../includes/javascript/lpStatus.php?', true);
      xmlHttp.onreadystatechange = handleResponse;
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.send('do=status');
   }

   function handleResponse() {
      var returnedString;
      if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') {
         returnedString = xmlHttp.responseText;
         if (returnedString != latestPostID) {
            return true;
         } else {
            window.location = 'client.php';
         }
      }
   }

   function createRequestObject() {
      var object;
      var browser = navigator.appName;
      if(browser == 'Microsoft Internet Explorer'){
         object = new ActiveXObject('Microsoft.XMLHTTP');
      } else {
         object = new XMLHttpRequest();
      }
      return object;
   }

PermaLink to this entry https://pastebin.co.uk/11537
Posted by AFNedreN Wed 7th Mar 2007 21:17 - Syntax is None/text - 265 views
Download | New Post | Modify | Show line numbers

 

Comments: 0