title: AJAX function to Update A Page Value Without Refresh
body: <p>I'm not familiar with AJAX, I need to update a value in a JSP page using a database table. Please help me to write the relevant AJAX part. What is currently I have done is like below, where the page only updates the value on refresh.</p>
  
  <pre><code>&lt;script&gt;
  //Ajax code here
  &lt;/script&gt; 
  &lt;body&gt;
      &lt;%ResultSet rsplayer = db.selectQuery("select score, playerid from player where playerid = '100'"); while(rsplayer.next()){%&gt;
      &lt;h1&gt;&lt;%out.print(rsplayer.getString("playerid"));%&gt; = &lt;%out.print(rsplayer.getString("score"));%&gt;&lt;/h1&gt;
      &lt;%}%&gt;
  &lt;/body&gt;
  </code></pre>