title: How to use jQuery to allow the user to only vote once?
body: <p>I have an app that allows users at the same company on the same login to vote on specific items, therefore I'm unable to use IP to control how many times the user votes. How can I use jQuery to allow the user to only vote once?</p>
  
  <p><strong>jQuery:</strong></p>
  
  <pre><code>$("#xmlDiv").on("click", ".upvote", function(e) {
              var id = $(this).attr("id");
              var main = $(this);
              $.ajax({
                  type: 'post',
                  url: 'includes/upvote.php',
                  data: { "id":id }, 
                  success(data) {
                  main.parent().find("div.votenum").html(data);
                  },
                  error: function (xhr, textStatus, error) {
                      alert("Sorry!");
                  }
              });
          });
  
  $("#xmlDiv").on("click", ".downvote", function(e) {
          var main = $(this);
          var id = $(this).attr("id");
          $.ajax({
              type: 'post',
              url: 'includes/downvote.php',
              data: { "id":id }, 
              success(data) {
                  main.parent().find("div.votenum").html(data);
              },
              error: function (xhr, textStatus, error) {
                  alert("Sorry!");
              }
          });
      });
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;img src="arrow-up-01-20.png" style="float:right;" class="upvote" id="5"&gt;
  &lt;img src="arrow-down-01-20.png" id="5" class="downvote" style="float:right;"&gt; 
  &lt;div class="votenum" style="float:right;" id="5"&gt;12&lt;/div&gt;
  </code></pre>