ActiveX File Contents Read

File Contents Read

<html> 
   <head> 
      <title></title> 
      <script type="text/javascript"> 
         function fillup(url) { 
            var content=document.getElementById('content'); 
            if (window.XMLHttpRequest) { // Fx 
               xmlhttp=new XMLHttpRequest(); 
               xmlhttp.onload=function() { 
                  if(xmlhttp.readyState==4) 
                     content.innerHTML=xmlhttp.responseText; 
               } 
            } 
            else if (window.ActiveXObject) { // IE 
               xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
               xmlhttp.onreadystatechange=function() { 
                  if(xmlhttp.readyState==4) 
                     content.innerHTML=xmlhttp.responseText; 
               } 
            } 
            xmlhttp.open("GET",url,true); 
            xmlhttp.send(null); 
         } 
         window.onload=function() { fillup('file.txt'); }
      </script> 
</head> 
<body>
<div id="content"></div></div>
</body> 
</html>