• Resolved localhost_8080

    (@localhost_8080)


    Hi there,

    Love your plugin and it’s beautifully designed.

    It works very well. I guess it’s my problem.
    I added a custom field in the comment form, along with some javascript codes. Before posting a comment, everything works properly. After posting a comment, the new comment was successfully posted and showed on the page, but my own javascript codes were all dead.
    Is it because I add the javascript code in window.addEventListener(‘load’, function() {} ) ?
    If so, where should I place my code?

    Sorry to bother you if this has nothing to do with your plugin.
    Thank you for delivering this useful plugin.

    https://www.ads-software.com/plugins/wp-ajaxify-comments/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter localhost_8080

    (@localhost_8080)

    I added the following code in the end of formSubmitHandler:

    jQuery(function($) {
        $.getScript('External_JS_File_Path.js', function() {});
    });

    it somehow worked. Not sure if it is an acceptable solution.

    Hi localhost_8080,

    you can use the “onAfterUpdateComments” callback option to add your own JavaScript code that should be executed after the comments have been replaced.

    Hope this helps…
    Jan

    Thread Starter localhost_8080

    (@localhost_8080)

    Hi Jan,

    I moved the code to “onAfterUpdateComments” callback, and it works. A big thank you from Beijing ??

    Thanks for your feedback.

    Please think about supporting the plugin by making a small donation or writing a short review.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Own javascript not working after posting a comment’ is closed to new replies.