After searching the forum and J docs and trying various things i have not been able to modify the behavior of components/com_k2/js/k2.js. Is there a way to do this? We are using J3.4.1 and k2 2.6.9
We are trying to redirect the page after the comment has been successfully submitted into the database. Changing the core k2.js file as below it gets our desired result.
// Comments
$K2('#comment-form').submit(function(event){
event.preventDefault();
$K2('#formLog').empty().addClass('formLogLoading');
$K2.ajax({
url: $K2('#comment-form').attr('action'),
type: 'post',
dataType: 'json',
data: $K2('#comment-form').serialize(),
success: function(response){
$K2('#formLog').removeClass('formLogLoading').html(response.message);
if(typeof(Recaptcha) != "undefined"){
Recaptcha.reload();
}
if (response.refresh) {
window.location.reload();
}
window.location.assign("http://www.oursite.com");
}
});