Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Plugins by

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
tell me plz where to insert this code to it to perform
1. Either use your advanced theme and output in the headscript the javascript.
2. Or write yourself a little plugin.
3. Or abuse the page.js in folder qa-content.

Note: Always enclose the code above in a jquery.ready function.
I put this code in an existing plug-in (output in the headscript the javascript), but this code is called only when reloading the page and not load when clicking the answer button. My version 1.6. Class answer button same "qa-form-tall-button-answer" .
what could be the reason?
Check if the code is visible in the HTML.
Ок, 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.