title: Read data from a text file and embed it to an HTML webpage . How?
body: <p>I have a HTML file like this..</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;table border="1" cellpadding="5"&gt;
  &lt;tr&gt;
  &lt;td&gt;Some Fixed text here&lt;/td&gt;
  &lt;td id="data"&gt;---here data as per values in external text file---&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now i have a text file <strong>data.txt</strong> in same directory of the <em>index.html</em> file.</p>
  
  <p>I have to read the text file using some <strong>scripts</strong> and  put fixed innerHTML in the <strong>id=data</strong> as per values in the <em>first character of the text file</em>.</p>
  
  <p>Such as</p>
  
  <p>for  <strong>0</strong> in first character , innerHTML=<code>&lt;div style="color:red; border:2px dotted blue;"&gt;Alpha&lt;/div&gt;</code></p>
  
  <p>for <strong>1</strong> in first character, innerHTML=<code>&lt;div&gt;Beta&lt;/div&gt;</code></p>
  
  <p>for <strong>2</strong> in first character, innerHTML=<code>&lt;div&gt;Gamma&lt;span&gt;more text&lt;/span&gt;&lt;/div&gt;</code></p>
  
  <p>etc...</p>
  
  <p>I found various scripts which used jquery,ajax. I tried those, and they didn't work for me. As I have not much knowledge about those technologies I cannot find the problem. Can anyone help me to make a script using  javascript or similar?</p>