Title: [Plugin: Ajax Comment Posting] duplicate script loading bug fix
Last modified: August 19, 2016

---

# [Plugin: Ajax Comment Posting] duplicate script loading bug fix

 *  Resolved [vonkanehoffen](https://wordpress.org/support/users/ttr738/)
 * (@ttr738)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-ajax-comment-posting-duplicate-script-loading-bug-fix/)
 * Just a note to say thanks for the plugin and here’s (maybe) a bug fix for you:
 * I had trouble with the plugin reloading other scripts on the page once it received
   it’s response from wp-comments-post.php
    This was because wp-comments-post.php
   spits back an entire wordpress page, complete with headers and footers, and the
   jquery parses it:
 *     ```
       var response = $("<ol>").html(data);
       ```
   
 * to get round this, I changed that line to:
 *     ```
       comment_response = data.split('<!-- BEGIN: COMMENTS -->');
       comment_response = comment_response[1].split('<!-- END: COMMENTS -->');
       var response = $("<ol>").html(comment_response[0]);
       ```
   
 * and put <!– BEGIN: COMMENTS –> and <!– END: COMMENTS –> at either end of comments.
   php in my template. Worked fine and stopped a lot of weird behaviour!
 * Yes, I am aware there are probably far elegant solutions, but I hope that helps
   someone out there 🙂
    [http://wordpress.org/extend/plugins/ajax-comment-posting/](http://wordpress.org/extend/plugins/ajax-comment-posting/)

The topic ‘[Plugin: Ajax Comment Posting] duplicate script loading bug fix’ is closed
to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [vonkanehoffen](https://wordpress.org/support/users/ttr738/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-ajax-comment-posting-duplicate-script-loading-bug-fix/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
