title: How to call ajax only once
body: <p>I call function from this code :</p>
  
  <pre><code>    &lt;div id="header-button-news" class="header-button-info"&gt;
          &lt;a href="javascript:;" title="Новости" onclick="showNews()"&gt;&lt;/a&gt;
          &lt;div class="new"&gt;2&lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My function is</p>
  
  <pre><code>function showNews()
  {          
          //other js which show block 
  
          jQuery("#loader").show();
  
  
          //ajax which load content to block
          jQuery.ajax({
              type: "GET",
              url: link,
              dataType: "html",
              success: function(data) {
                  jQuery('#top-info-news').html(data);   
              },
              complete: function(){
                  jQuery('#loader').hide();
              },
          });
  }
  </code></pre>
  
  <p>How can I make only once ajax call? so when content is loaded and page was not refresed not to load ajax? I tried to do boolean variables but nothing, I suppouse it is because I call everytime function. Please give me an idea how to do.</p>
  
  <p>thank you </p>