title: Is there away to load a page only once with AJAX?
body: <p>I have an AJAX call to load a function once the page is loaded, the function opens a lightbox a like frame with some data. The issue is that if I click on close (lightbox frame), the page loads again and again loading the frame so the use never reaches the page under the layer of frame since the frame load on infinite loop. The Ajax is repeating calling the function I guess but I would like to load the frame once and when the user clicks X (close) he may return to the original page.</p>
  
  <pre><code>$(document).ready(function(){
  var city = $('#citycode').html();
  
  $.ajax({
  //when page is loaded, fire the following function
  success: function(){
  //the function to be fired located in the page in seperate file
  openX(city + //some other parameters);
  }});
  
  
  });
  </code></pre>
  
  <p>Any tips?</p>