title: Page shows duplicate posts everytime i click on button
body: <p>I am having a strange issue with Jquery Mobile. I had created a Page which displays posts and is displaying posts correctly.</p>
  
  <p>Now the issue is, whenever i click on back button and click on the posts button again, it duplicates the posts and display. The number of times i click on back button and click on post button, Posts gets duplicated accordingly and shows in multiples.</p>
  
  <p>For example, i have a post that is being displayed. Now i click on back button and then click on show posts button, this time, the same post displays twice. Now again if i click back button and then click on show posts button, it now the same post shows thrice and so on.</p>
  
  <p>But if i refresh the page after every back button click, then it shows the posts correctly. Can anyone guide me where i am going wrong?</p>
  
  <p>Here is the Code:</p>
  
  <p>HTML PAGE:</p>
  
  <pre><code>&lt;div data-role="page" id="userpost"&gt;
      &lt;div data-role="header" data-theme="b"&gt;
          &lt;a class="back" class="button button-clear" data-rel="back" data-icon="back" href="#"&gt;back&lt;/a&gt;
          &lt;p style="text-align: center"&gt;Posts History&lt;/p&gt;
      &lt;/div&gt;
      &lt;div data-role="content"&gt;
          &lt;p id="username"&gt;&lt;/p&gt;
          &lt;div class="row cf" id="userPosts"&gt;
          &lt;/div&gt;
  
          &lt;div data-role="footer" data-position="fixed" data-theme="b"&gt;
              &lt;h6&gt;&amp;copy;&lt;/h6&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JQuery Code:</p>
  
  <pre><code>function displayuserPosts() {
      if (localStorage.login = "true") {
          var username = localStorage.username;
          $('#username').append("&lt;p style='font-size:10px; color:red; text-align:center;'&gt;Welcome: " + username + "&lt;/p&gt;");
          var userPosts = "username=" + username + "&amp;upost";
          $.ajax({
              type: "GET",
              url: "../php-code2/uposts.php",
              data: userPosts,
              dataType: "json",
              success: function (data) {
                  $.each(data, function (i, field) {
                      $("#userPosts").append('&lt;p class="job cf"&gt;'+ field.title +'&lt;/p&gt;');
                  });
              }
          });
      } else {
          alert("Please login to post a Job");
          window.location.href = "#Main";
      }
  }
  </code></pre>