Document javascript error alert

If an error occurs when uploading docs via ajax this will display an
alert box with the errors.