title: Modifying server side text file
body: <p>Currently I am working on static HTML website. Now I am using following javascript code to read server side text file:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
      function loadXMLDoc() {
          var xmlhttp;
          if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
              xmlhttp = new XMLHttpRequest();
          }
          else {// code for IE6, IE5
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          }
          xmlhttp.onreadystatechange = function () {
              if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) {
                  document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
              }
          }
          xmlhttp.open("GET", "results.txt", true);
          xmlhttp.send();
      }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="myDiv"&gt;&lt;h2&gt;content&lt;/h2&gt;&lt;/div&gt;
  &lt;button type="button" onclick="loadXMLDoc()"&gt;Change Content&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>Here on click event data is just displayed.But now I want to change the content of text file on click event.I want to increment the number by 1 which resides in the file as content.</p>
  
  <p>Please help me to do this...Thank you so much in advance.!!</p>
  
  <p>EDIT:</p>
  
  <p>I am using windows hosting.</p>