Added new method that should choose to deliver the error message
differently depending on whether the initial request was made via ajax
or not.