The html file having this script should be in the same domain with txt file for accessing from mozilla firefox because of security reason. From internet explorer txt file from any url can be read.
var xmlhttp;
function getFile(pURL) {
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",pURL,true);
xmlhttp.onreadystatechange = showFileContent;
xmlhttp.send(null);
}
function showFileContent() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200) {
var out=xmlhttp.responseText;
document.getElementById('theExample').innerHTML=out;
}
}
}
See my codes, 1 having this script and reads contents from 2.
Monday, July 21, 2008
Subscribe to:
Post Comments (Atom)
1 comment:
change the links man
now they are on appspot...
Post a Comment