Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
980 views
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
by
tell me plz where to insert this code to it to perform
by
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.
by
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?
by
Check if the code is visible in the HTML.
by
Ок, 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.

...