Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › searching for term which does not exist breaks system › Reply To: searching for term which does not exist breaks system
July 28, 2022 at 12:31 pm
#38609
Keymaster
Okay, try this variation isntead:
add_action('wp_footer', 'asp_footer_custom_script', 999999);
function asp_footer_custom_script() {
?>
<script>
jQuery(function($){
$('.prosettings').one('click', function(){
$('.asp_option_cat').on('click', function(){
$('.asp_m').on('asp_search_end', function(){
location.href = location.href;
});
});
});
});
</script>
<?php
}
This one seems to work okay when I test it via the console. It will wait until the search is finished, then do the refresh.