Is it compulsory for a server to respond in xml to an ajax call?
A) Yes, all AJAX requests must receive XML responses.
B) No, AJAX requests can receive responses in various formats, including JSON, XML, or plain text.
C) Only if the AJAX request explicitly specifies XML as the response format.
D) It depends on the client-side scripting language used in the AJAX call.
Answer:
B) No, AJAX requests can receive responses in various formats, including JSON, XML, or plain text.
Explanation:
AJAX requests can receive responses in different formats based on what the server and client agree upon. While XML is one option, JSON and plain text are also commonly used response formats for AJAX calls. The choice of format depends on the application’s requirements and how it’s implemented.