Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Tip: Change ajax submitted content

+1 vote
302 views
asked Dec 5, 2014 in Plugins by q2apro

I had a tough time finding out how to change the HTML content that gets ajax-loaded after you submit an answer (clicking the answer button).

To modify the elements, you can use Jquery!

Example: Hide the comment button only below the submitted answer:

                            $('.qa-form-tall-button-answer').click( function() {
                                $(document).ajaxSuccess(function() {
                                    // hide ajax inserted button
                                    $('.qa-a-list-item:first-child .qa-a-item-main .qa-a-item-buttons .qa-form-light-button-comment').hide();
                                });
                            });
 

Hope that helps anybody.

Q2A version: 1.7 beta
commented Dec 10, 2014 by q2apro
Check if the code is visible in the HTML.
commented Dec 10, 2014 by Vadim Molchanov
Ок, working!!! i forgot you tip: "Note: Always enclose the code above in a jquery.ready function."

Sanks! i use this for highlighting code.

Please log in or register to answer this question.

...