I am injecting the following code into a specific page. The code refreshes a specific DIV class every 3 seconds without reloading the entire page.
jQuery(document).ready(function($) {
$.ajaxSetup({ cache: false });
setInterval(function() {
$('.activity-comments').load(location.href + ' .activity-comments')
}, 3000);
});
I would like to change this code so that it only refreshes the DIV class after a specific form is submitted (without reloading the entire page). Below are the details of the form:
<form class="comment-form" action="/comment/reply/111" method="post" id="comment-form" accept-charset="UTF-8">
<input type="submit" id="edit-submit" name="op" value="Comment" class="form-submit art-button ajax-processed">
I'm not sure if using .load is the most optimized method for doing this. How can I change my code to achieve this?