added ajax for delete operation and separated js code