0

I have a Ajax Javascript/jQuery function which refreshes the content of a div every 5 seconds. This works fantastically when the page is viewed from the front end. When viewing the same page in Customizer and changing content on the page it will refresh this div one time, but not if I change it once again. Is there something in the Customizer that prevents scripts from being run more than once?

jQuery(document).ready(function($) {
function searchTitleFetch() {
  $.ajax({
    success: function(data) {
      var result = $('<div />').append(data).find('.search-title').html();
      $('.search-title').html(result);
    }
  });
}
setInterval(searchTitleFetch, 1000);
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.