title: getting input from click event in javascript and sending it to django or saving it as text file
body: <p>I have an html file that's a dataframe class.  I added click event to each row.  I want to send fName, lName, Address, Zip to django views.py to do some internal querying.  I am under the impression that I need to use ajax for this.  I'm new to javascript and Ajax and have no idea how to incorporate this into the code.  Any help would be appreciated.  If there is a way for me to save these variables to a txt file, then i can call another function within Django and do it that way.  Not sure, if saving it to text file is the right way to do this. </p>
  
  <pre><code>#sample HTML file
  
  &lt;table border="1" class="dataframe"&gt;
  &lt;thead&gt;
    &lt;tr style="text-align: right;"&gt;
      &lt;th&gt;first&lt;/th&gt;
      &lt;th&gt;LastName&lt;/th&gt;
      &lt;th&gt;Address&lt;/th&gt;
      &lt;th&gt;zip&lt;/th&gt;
      &lt;th&gt;State&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;mary&lt;/td&gt;
      &lt;td&gt;poppins&lt;/td&gt;
    &lt;td&gt;3345 leanie rd&lt;/td&gt;
    &lt;td&gt;28277&lt;/td&gt;
    &lt;td&gt;PA&lt;/td&gt;
  &lt;tr&gt;
     &lt;td&gt;honas&lt;/td&gt;
     &lt;td&gt;bond&lt;/td&gt;
     &lt;td&gt;1123 cavalry st&lt;/td&gt;
     &lt;td&gt;38788&lt;/td&gt;
     &lt;td&gt;GA&lt;/td&gt;
  
  function addRowHandlers(tableId) {
  if(document.getElementById(tableId)!=null){
      var table = document.getElementById(tableId);
      var rows = table.getElementsByTagName('tr');
      var fname = '';
      var lname = '';
      var address = '';
      var zip = '';
      var State = '';
      for ( var i = 1; i &lt; rows.length; i++) {
  
          rows[i].i = i;
          rows[i].onclick = function() {
  
              fname = table.rows[this.i].cells[0].innerHTML;                
              lname = table.rows[this.i].cells[1].innerHTML;
              address = table.rows[this.i].cells[2].innerHTML;
              zip = table.rows[this.i].cells[3].innerHTML;
              state = table.rows[this.i].cells[4].innerHTML;
              alert(fname +' ' + lname + ' ' + address +' '+ zip +' '+ state + ' ');
              };
          }
       }
  }
  &lt;/script&gt;
  #views.py
  def query_result(request):
  fname = request.GET(//what do I type here?//)
  </code></pre>