title: Setinterval is not working properly
body: <p>If i use setinterval with strings then it works fine,but it also  loads the chat related to prvious id(cityid) set by onclick. and secreen shuffles after every second between chat related to new id(cityid) on new click and previous id.I want to stop the timer if it is running by previous id,and fetch only chat related to new id,so that new chat only related to new id will b shown.</p>
  
  <p>Plz help,any alternative approach will also be appretiated.</p>
  
  <p>Php onclick is here</p>
  
  <pre><code>            echo "&lt;A href='#'  onclick=allccityid('$comid','$comname',$cityid,'$cities');&gt;$cities&lt;/A&gt;&lt;br&gt; ";
  </code></pre>
  
  <p>Jquery code is here.</p>
  
  <pre><code>function all(comid,comname,cityid,cname){
  //clearInterval(si);
  
   setInterval('chatcom_load('+ comid +','+ cityid +');', 1000)
  
   }
  
  
   function chatcom_load(idi, cityida) {
  
  $.post('sendchat2.php', {option:'chatcom_load', tocom:idi, tocity:cityida}, function(data) {
      $('#chatcom #commid #commidwin').html(data);
  
  });
  }
  </code></pre>
  
  <p>However I also try  the setinterval by this way,but it did not work(refresh).I must  have to pass Two parameters to the chatcom_load function.</p>
  
  <pre><code>setInterval(chatcom_load(comid, cityid), 1000)
  </code></pre>