Greetings,
I was trying to discover a proper way to send captured errors or business logic exceptions to the client in an Ajax-PHP system. In my case, the browser needs to react differently depending on whether a request was successful or not. However in all the examples I've found, only a simple string is reported back to the browser in both cases. Eg:
if (something worked)
echo "Success!";
else
echo "ERROR: that failed";
Tarayıcı Ajax yanıtı geri döndüğünde, bir hata oluştu bilmek tek yolu (belki de 'hata' arıyor) dizesini ayrıştırmak olacaktır. Bu aksak görünüyor.
Is there a better/proper way to send back the Ajax response & notify the browser of an error?
Thank you.