Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readTheFile() {
- if (window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.open("GET", "http://hostname/textfile", false);
- xmlhttp.send();
- var text = xmlhttp.responseText;
- document.getElementById("text").innerHTML=("Text: " + text);
- }
Advertisement
Add Comment
Please, Sign In to add comment