I am wondering what is the best practice to show the user an alert() box with a given message (from server side) during an AJAX request.
Here is an example: Let's say I have an event handler method for handling the drop of a row and the action is performed with AJAX. Now I discover on the server side that the drop is not legal (e.g. he is not allowed to drop a row onto some object) and I would like to show a simple javascript alert() box with "Sorry, you cant drop X on Y cause you have no permission."
The message comes from the server side as it reflects business rules. the best thing would be to throw an exception as this is displayed in an alert box but I cant do it in our app as exceptions are handled globally and posted to an exception log which is used in QA.
Here is an example: Let's say I have an event handler method for handling the drop of a row and the action is performed with AJAX. Now I discover on the server side that the drop is not legal (e.g. he is not allowed to drop a row onto some object) and I would like to show a simple javascript alert() box with "Sorry, you cant drop X on Y cause you have no permission."
The message comes from the server side as it reflects business rules. the best thing would be to throw an exception as this is displayed in an alert box but I cant do it in our app as exceptions are handled globally and posted to an exception log which is used in QA.