Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Benjosity

    (@benjosity)

    Hi jfvwork

    I’ve put it in my JavaScript/jQuery file where all my JavaScript and jQuery is.

    You could also place it in your header.php file like so –

    <script type="text/javascript">
    jQuery('.simplefavorite-button').click(function(event) {
        jQuery(document).ajaxSuccess(function() {
            location.reload();
        });
    });
    </script>

    I would reccomend you put it within your site’s js file though.

    Thread Starter Benjosity

    (@benjosity)

    Hi Nickylew

    In the end I created a jQuery function that refreshed the page after the button had been clicked and the AJAX success event had gone through –

    $('.simplefavorite-button').click(function(event) {
        $(document).ajaxSuccess(function() {
            location.reload();
        });
    });

    It’s not exactly what I wanted but it’s all I could figure out without any experience with AJAX and it essentially solves the main issue of not having any PHP loops update after clicking the favourite button.

Viewing 2 replies - 1 through 2 (of 2 total)