WordPress.org

Ready to get started?Download WordPress

Forums

WP-Ajaxify-Comments
[resolved] First comment reloads the page (8 posts)

  1. andy999
    Member
    Posted 1 year ago #

    Plugin is fantastic!

    I'm using it for a site I'm developing just now (locally hosted at the moment so I can't link to it).
    Strange problem, I have my selectors all set up and it works fine 'most' of the time, yet the FIRST comment on any post always reloads the page.
    The second, third, fourth comments all load in via ajax just fine.

    I took some screenshots of the console with Ajaxify comments in debug mode, maybe that'll help you diagnose what's going on.

    Here's a screenshot of the web inspector when the first comment (that reloads the page) is posted.
    http://i.imgur.com/H7hwnKu.png

    Here's a screenshot of the web inspector when the second comment (that loads in via ajax perfectly) is posted.
    http://i.imgur.com/QYdXGlw.png

    I had to blur out the site name since it's a client development, but all the other info is there.

    Thanks for the help!

    http://wordpress.org/extend/plugins/wp-ajaxify-comments/

  2. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Could you please send me the debug output after the comment was submitted for the first comment and before the page reloads. If you enable the debug mode, the plugin will sleep for 5 seconds to enable analyzing the debug messages before the page is reloaded.

  3. andy999
    Member
    Posted 1 year ago #

    I just realised, when the page loads initially it's saying "[WP-Ajaxify-Comments] Search comments container (selector: 'ol.commentlist')... Not found "

    I think this is why it's reloading the page, because initially there is no comments list since there's no comments.

  4. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that seems to be the cause of the problem.

    You can either modify your theme or use the JavaScript callback options 'OnBeforeSelectElements' to add the "ol.commentlist" element (as empty list) exactly at the position where the comments should be injected after the first comment was posted.

    Hope this helps...

  5. andy999
    Member
    Posted 1 year ago #

    I added the list's parent container as the element it's targeting, it seems to be working for now.

    I was worried that it'd need a 'list' to inject the comments into and it couldn't be the parent of the list.
    Hope I'm right...

  6. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Sounds great. I will close this ticket now. If you have further problems, I need access to your site to examine the problems in detail. Please don't hesitate to open a new thread...

    Please think about supporting the plugin by making a small donation (http://blog.janjonas.net/donate) or write a short review (http://wordpress.org/support/view/plugin-reviews/wp-ajaxify-comments#postform).

    Thanks in advance,
    Jan

  7. janjonas
    Member
    Plugin Author

    Posted 1 year ago #

    Resolved.

  8. andy999
    Member
    Posted 1 year ago #

    Thanks, Jan.

    I'll make a donation once my site goes live, your plugin is that good. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.