Guest User

Untitled

a guest
Jul 6th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function readTheFile() {
  2.                
  3.                     if (window.XMLHttpRequest) {
  4.  
  5.                         xmlhttp = new XMLHttpRequest();
  6.  
  7.                     } else {
  8.  
  9.                         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  10.  
  11.                     }
  12.  
  13.                     xmlhttp.open("GET", "http://hostname/textfile", false);
  14.                     xmlhttp.send();
  15.                
  16.                     var text = xmlhttp.responseText;
  17.                     document.getElementById("text").innerHTML=("Text: " + text);
  18.                
  19. }
Advertisement
Add Comment
Please, Sign In to add comment