Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save VictorPietro/73c9b159bc264a7ee873a5703e88f77d to your computer and use it in GitHub Desktop.
Save VictorPietro/73c9b159bc264a7ee873a5703e88f77d to your computer and use it in GitHub Desktop.
AJAX Reload Listing/Table and JetPopup after JetFormBuilder submit
jQuery(document).ready(function($) {
$('.micro-unit-type-submit-button').on('click', function() {
let listingSelector = '.elementor-element-085ed4a'; // Your listing grid selector
// Reload title
$('.elementor-element-bdcf9fb').load(window.location.href + ' .elementor-element-bdcf9fb');
// Reload the listing grid
$(listingSelector).load(window.location.href + ' ' + listingSelector, function() {
console.log('Listing reloaded!');
// Reinitialize JetPopup for Elementor-based popups
if (window.JetPopupFrontend && typeof window.JetPopupFrontend.maybeElementorFrontendInit === 'function') {
window.JetPopupFrontend.maybeElementorFrontendInit($(listingSelector));
console.log('JetPopup popups reinitialized successfully!');
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment