$(function() {
	$(document).on('submit', '.comments form', function() {
		var $form = $(this);
		$.ajax({
			url: location.href,
			type: 'POST',
			data: $form.serialize(),
			success: function(response) {
				if(response.length == 0) {
					location.reload();
				} else {				
					$form.replaceWith($(response).find('.comments form'));
				}
			}
		});
		return false;
	});
	
});

