Skip to content

Instantly share code, notes, and snippets.

@moxet
Created February 23, 2024 17:17
Show Gist options
  • Save moxet/622daf98a5ac2ea28cece8ea1a4993bb to your computer and use it in GitHub Desktop.
Save moxet/622daf98a5ac2ea28cece8ea1a4993bb to your computer and use it in GitHub Desktop.
This JQuery allows you to refresh listing without page refresh, make sure to apply .mylisting class to your listing. The timeout function improve the UX by hiding success message after 3 seconds
<script>
jQuery(document).ready(function($) {
$('.jet-form-builder__submit').on('click', function() {
$('.mylistings').load(window.location.href + ' .mylistings');
setTimeout(function() {
$(".jet-form-builder-messages-wrap").fadeOut();
}, 3000);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment