Implement javascript delete handling