I have been making a threaded comment system as a way to learn php and javascript/jquery properly. Ive done bits and bobs in the past but ive made a new years resolution to learn it properly.
Im having trouble inserting a reply form into the comment tree below the comment being replied to. I know this is probably pretty basic but how do you insert html into a page when someone clicks a link.
This code wasn't working for me:
$(document).ready(function(){
    $(function() {
        $('a#reply').click(function() {
            $(this).append("the html blah");    
        });
    });
}); 
Anyone see where im going wrong?
$(document).ready(function(){
        $('a#reply').click(function() {
            $(this).after("the html blah");
            return false;
        });
});
You may need the 'return false;' in there to stop the page from reloading itself when you click on the link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With