Hi,
I am new to ajax, and just would like to ask an idea on how to implement this requirement.
Assuming, user is filling up a form and on the UserID field, I want to fire an ajax request to the server to check if it is existing so that I could notify him that it is already taken.
Now, I dont know how to go about doing this request.
I am thinking between two solution that I have thought.
Option 1:
If it exist, throw an exception and let the error callback of the jquery ajax call handle the request.
Option 2:
Return a JSON response from the server with below format parse it and then set the content appropriately.
I am not sure which one is the better solution or I maybe there is a better alternative other than what I have thought.
Looking forward for your thoughts..