Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>SBRF ACARS</title>
  4. <script language="Javascript">
  5. function xmlhttpPost(strURL) {
  6. var xmlHttpReq = false;
  7. var self = this;
  8. // Mozilla/Safari
  9. if (window.XMLHttpRequest) {
  10. self.xmlHttpReq = new XMLHttpRequest();
  11. }
  12. // IE
  13. else if (window.ActiveXObject) {
  14. self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
  15. }
  16. self.xmlHttpReq.open('GET', strURL, true);
  17. self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  18. self.xmlHttpReq.onreadystatechange = function() {
  19. if (self.xmlHttpReq.readyState == 4) {
  20. updatepage(self.xmlHttpReq.responseText);
  21. }
  22. }
  23. }
  24.  
  25. function updatepage(str){
  26. xmlhttpPost("/cgi-bin/simple-ajax-example.sh");
  27. xmlHttpReq.send();
  28. document.getElementById("result").innerHTML = str;
  29. }
  30. setInterval(updatepage, 1000);
  31. </script>
  32. </head>
  33. <body>
  34. <p>Irrelevant text</p>
  35. <div id="result"></div>
  36. </form>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement