Ajax Server Response

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

Ajax Server Response, responseText and responseXML

once we send the request to the destination [ server ], we will get the response from the server in twoformats either in Text or XML, i mean we can get the response from the server by using responseTextand responseXML propertys of our XMLHttpRequest object

Actually..
responseText — for getting the response in the format of text
responseXML — for getting the response in the format of XML
You can see this in the first example

Or check this

Explanation

  • see we are getting the response in the form of text [ see line number 21 ]
  • once the response is ready, our div content will be replaced with the response text [ see line number 32 ]

Will see more while discussing Ajax with Servlets