title: How to update different parts of a web page dynamically?
body: <p>I have a script that updates information of my website, it loads the date from another page every second and with this i can have a clock on my website that updates ever second. However i want to do the same sort of thing but with another part of my website.</p>
  
  <p>This is the code im using so far:</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
  
      $(document).ready(function() 
      {
          $("#myDiv").load("response.php");
          var refreshId = setInterval(function() 
          {
              $("#myDiv").load('time.php');
          }, 1000);
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and then when i was to display the time i use:</p>
  
  <pre><code> &lt;div id="myDiv"&gt; &lt;/div&gt;
  </code></pre>
  
  <p>So how could i use it on another part of my website? Would it be wise to code the script and change the '#myDiv' to something else like '#myDiv2' or is there another way i could do it in the same script?</p>
  
  <p>I want to know the best practise for this situation.</p>
  
  <p>Thanks for the time.</p>