title: How to load the contents in the text file or the html codes in a html-file to a textarea by browsing it first?
body: <p>Using javascript, how to open a text-file or html-file from  a web-page and load the contents in the text file or the html code to a textarea. Please Dont tell me this not possible using javsscript, it is possible but i dont know the code and my bro not coming home for a week . Example codes will be greatly appreciated. (i have already asked this question but everyone seemed to concentrate on the other part of the question.)</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form name="abc"&gt;
  &lt;textarea name="text"&gt;loaded text here&lt;/textarea&gt;
  &lt;input type="button" onClick=""&gt; open file
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I found this in a forum , dont remember name , This is a working code but can only load text files .... now the question is how can I get it to fetch htmlcodes from a html file.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;meta http-equiv="Content-Language" content="en-us"&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
  var ForReading = 1, ForWriting = 2, ForAppending = 8;
  var objFSO = new ActiveXObject("Scripting.FileSystemObject");
  
  function loadFile(btn, obj, div, fld) {
  objFile = objFSO.GetFile(obj.value);
  objStream = objFile.OpenAsTextStream(ForReading);
  fld.value = objStream.ReadAll();
  objStream.Close();
  objStream= null;
  fileSpecs(div, btn);
  objFile = null;
  return true;
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form name="myForm" onsubmit="return false;"&gt;
  
  &lt;textarea rows="25" name="fileArea" cols="70"
  onkeypress="return checkText(this, btnSave);"&gt;&lt;/textarea&gt; &lt;/td&gt;
  
  
  &lt;input type="file" name="fileName" size="50"
  onchange="return checkFile(this, document.getElementById('fileSpec'), btnLoad, btnSave, fileArea);"&gt;
  
  &lt;input type="button" name="btnLoad" value="Load" 
  onclick="return loadFile(this, fileName, document.getElementById('fileSpec'), fileArea);"&gt; 
  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is another one the coder claims it to be working but it is nt working for me , please execute this code if u hav time ...if it is working please provide the complete code here.
  (coded by Ancora)</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  
  function init(){
  
  var extText = window.frames.messageTxt.document.body.lastChild.lastChild.data;
  extText = extText.replace(/[\r\n]/g," ");
  document.forms[0].nMessage.value = extText;
  }
  
  window.onload=init;
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;iframe name='messageTxt' src='txtData.txt'  style='display:none'&gt;&lt;/iframe&gt;
  &lt;form&gt;
  &lt;textarea name='nMessage'&gt;&lt;/textarea&gt;
  &lt;input type="button" value="click" onClick="init()"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i guess no can do this...i had a javascript that can load htmlcode form an external html file into the textarea. But i lost that file, sad no one here has the scripting abilities to create a js function (or active x) that can do the same.</p>