can someone write me simple js
Posted: Mon Feb 28, 2005 3:50 pm
I need that script read external file in write its content to variable. Maybe someone will be able to help me. I have tried do it by myself, but i have failed ![Frown :(](./images/smilies/icon_evil.gif)
![Frown :(](./images/smilies/icon_evil.gif)
SolusVM VPS management, cPanel/WHM/Fantastico, webdesigning help and discussion forums. Get help from co-webmasters and professionals!
https://smokyhosts.com/forums/
Code: Select all
var xhr
if (ActiveXObject("Msxml2.XMLHTTP"))
{
xhr = new ActiveXObject("Msxml2.XMLHTTP")
}
else if (ActiveXObject("Microsoft.XMLHTTP"))
{
xhr = new ActiveXObject("Microsoft.XMLHTTP"))
}
else {
xhr = new XMLHttpRequest()
}
xhr.open("GET", "filename.txt",true);
xhr.onreadystatechange=function() {
if (xhr.readyState==4) {
****.getElementById("divChange").firstChild.value = (xhr.responseText)
}
}
xhr.send(null)