<div id="text">
Text</div>
<script>
var text = document.getElementById('text');
ajax.open("GET","data.txt","true"); // data.txt file you want
// to retrieve
ajax.send();
</script>
var text = document.getElementById('text');
var ajax = new XMLHttpRequest(); // declare ajax object
ajax.onreadystatechange = function(){
text.innerHTML = ajax.responseText;
};
ajax.open("GET","data.txt","true"); // data.txt file you want
// to retrieve
ajax.send();
</script>
No comments:
Post a Comment