title: setInterval, ajax request
body: <p>What's the best way to fetch ajax request.</p>
  
  <p>mine gets gets faster and faster everytime it calls the javascript function
  i don't know why.</p>
  
  <p>here's the code : </p>
  
  <pre><code>$(function(){
  getSuggestions();
  });
  
  function getSuggestions(){
      var url = $("#baseUrl").val() + '/placement/suggestions/x-fetch-suggestions';
      var data ={}
      var result = myAjaxJson(data,url); //gets json object via ajax
  
  /* gets object 'sug' and put into #suggestions-list*/
      $('#suggestions-list').html(result.sug);
  
      var a = setInterval("getSuggestions()",5000);
  }
  </code></pre>