Passing variables in URL
<p>I have an address book widget that shows if there are contents.
If there are no contents, an add button will show up. Upon pressing the add button, it will redirect to another page which will show the form.</p>

<p>The initial design of my website is as follows:</p>

<ol>
<li><p>When the user click the add button, it will direct to a page using javascript function:</p>

<pre><code>document.location.href="address?addOnly=true";
</code></pre></li>
<li><p>The form will display. </p></li>
<li>If successful, there are $.post that will change the div only that will enable user to do CRUD in the address book.</li>
</ol>

<p>The problem with the variable inside the url which is address?addOnly=true is that when the user refresh it, it will always shows the add form. </p>

<p>That's why i've decided to hide the implementation using $.post</p>

<pre><code>$.post('address', {"listEmty":true}, function (data) {
  window.location = "address";
});
</code></pre>

<p>The problem with this is that it can't pass the variable at all.</p>

<p>My questions are:</p>

<ol>
<li>How to handle the page refresh if using the get method, which passes the paramater in the URL, </li>
<li>Are there anyways in javascript/jquery to pass the variable using post method then refresh the page?</li>
</ol>

<p>Thank you.</p>
