Title: Script error when trying to delete comment
Last modified: February 28, 2017

---

# Script error when trying to delete comment

 *  Resolved [Harm10](https://wordpress.org/support/users/harm10/)
 * (@harm10)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/script-error-when-trying-to-delete-comment/)
 * I am testing this promising plug-in.
    When I try to delete a comment a get a 
   script error: TypeError: SGComment.prototype.ajaxDelete is not a function 1 admin.
   php:1:1
 * What is wrong here?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Harm10](https://wordpress.org/support/users/harm10/)
 * (@harm10)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/script-error-when-trying-to-delete-comment/#post-8862806)
 * I did some investigating.
    In file sgComment.js in folder assets/page/scripts
   is the following code:
 *     ```
       SGComment.ajaxDelete = function(id) {
       	if (confirm('Are you sure?')) {
       		var deleteAction = 'Comment_ajaxDelete';
       		var ajaxHandler = new sgrbRequestHandler(deleteAction, {id: id});
       		ajaxHandler.dataType = 'html';
       		ajaxHandler.callback = function(response){
       			location.reload();
       		};
       		ajaxHandler.run();
       	}
       };
       ```
   
 * when changed to
 *     ```
       SGComment.prototype.ajaxDelete = function(id) {
       	if (confirm('Are you sure?')) {
       		var deleteAction = 'Comment_ajaxDelete';
       		var ajaxHandler = new sgrbRequestHandler(deleteAction, {id: id});
       		ajaxHandler.dataType = 'html';
       		ajaxHandler.callback = function(response){
       			location.reload();
       		};
       		ajaxHandler.run();
       	}
       };
       ```
   
 * the error is gone.
 * So please update your file!
 *  [Popup Builder Team](https://wordpress.org/support/users/popup-by-sygnoos/)
 * (@popup-by-sygnoos)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/script-error-when-trying-to-delete-comment/#post-8865082)
 * Dear User,
 * Thank you very much for reporting the issue!
    We’ve fixed it in our upcoming 
   update! There won’t be any this kind of problems in the updated version!
 * Best regards,
    Sygnoos Team.
 *  Thread Starter [Harm10](https://wordpress.org/support/users/harm10/)
 * (@harm10)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/script-error-when-trying-to-delete-comment/#post-8867565)
 * Thanks for replying and picking up the fix.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Script error when trying to delete comment’ is closed to new replies.

 * ![](https://ps.w.org/review-builder/assets/icon-128x128.jpg?rev=1581908)
 * [Review & Product Review by Review Builder](https://wordpress.org/plugins/review-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/review-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/review-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/review-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/review-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/review-builder/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Harm10](https://wordpress.org/support/users/harm10/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/script-error-when-trying-to-delete-comment/#post-8867565)
 * Status: resolved