I am building a bbpress forum and I have it set up right so that when you click a forum it displays a loading image and loads the link with ajax instead of redirecting the page

However, this loads the entire wordpress page, is there a way to just load what is generated by the shortcode [bbp-topic-index] on that particular link?

here's my code

    "use strict";
    var $ = jQuery;

        var loadingImage = $("#tsc-loading-image").attr("src");
        // overide forum/category links so that the open in tabby instead of a new page

         * loads a page into the active tabby tab, displaying a loading bar
         * @param {string} url - page to load into tab
        function loadTab(url){
            var activeTabText = $(".responsive-tabs__list__item--active"),
                activeTabBody = $(".responsive-tabs__panel--active"),
                tabTitle = activeTabText.text();
            activeTabBody.html("<img src='"+loadingImage+"' class='tsc-loading-icon' />");
            // restore text once it loads
            activeTabBody.load(url,'', function(){

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.