In your controller check if the request is an ajax request, if it is ajax then perform the operation and return the desired results in json format, in your view file have jquery deal with the results. where you check if the request is ajax, if it fails you should have mechanism set in place so your operation will still be completed if javascript on the browser is turned off.