How to update my html when the DB returns a value ?
<pre><code>&lt;script&gt;
function show(shown, hidden) {
  document.getElementById(shown).style.display='block';
  document.getElementById(hidden).style.display='none';
  return false;
}
&lt;/script&gt;

&lt;body&gt;

  &lt;div id="Page1"&gt;
    Content of page 1
    &lt;br&gt;&lt;br&gt;
    &lt;a href="#" onclick="return show('Page2','Page1');"&gt;Show page 2&lt;/a&gt;
  &lt;/div&gt;

  &lt;div id="Page2" style="display:none"&gt;
    Content of page 2
    &lt;br&gt;&lt;br&gt;
    &lt;a href="#" onclick="return show('Page1','Page2');"&gt;Show page 1&lt;/a&gt;
  &lt;/div&gt;

&lt;/body&gt;
</code></pre>

<p>In this code you see that 
<code>&lt;a href="#" onclick="return show('Page2','Page1');"&gt;Show page 2&lt;/a&gt;</code>
this code jump to page 2.</p>

<p>This code works fine but I need to do a little diffrent.When my db returns a value like 3,I want to jump the third page or if my db returns value of 2 I want to jump the second page. So my main problem is how can I take the return value and use it in this code ? </p>

<p><code>&lt;a href="#" onclick="return show('valueofreturn','Page1');"&gt;Show page return value&lt;/a&gt;</code></p>