I have an AJAX call to load a function after the page loads, the function opens the lightbox in the form of a frame with some data. The problem is that if I click the close button (lightboxes), the page loads again and again, loading the frame, so use never reaches the page under the frame layer since loading the frame in an infinite loop. Ajax repeats the function call, I think, but I would like to load the frame once, and when the user presses the X (close) button, he can return to the original page.
$(document).ready(function(){
var city = $('#citycode').html();
$.ajax({
success: function(){
openX(city +
}});
});
Any tips?
source
share