make a alert to display message when delete file error

display a popup(using alert)  message when delete file error. remove the element from DOM only when the AJAX call is success.Otherwise will display the error message.