Newsletter

Ajax Server Response, responseText and responseXML

Ajax » on Aug 26, 2011 { 5 Comments } By Sivateja

Once we send the request to the destination [ server ], we will get the response from the server in two formats either in Text or XML, i mean we can get the response from the server by using responseText and 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

You Might Also Like

  ::. About the Author .::

Java4s_Author
- Full Stack Java/J2EE & UI Web Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

5 Responses to “Ajax Server Response, responseText and responseXML”
  1. Leonard Pendon says:

    Really fantastic visual appeal on this website , I’d value it 10 10.

  2. Asif says:

    sir at first line of explation is two “are”.u can correct it.and love ur site very much.

  3. Java4s says:

    @Asif – I did the correction, thank you :-)

  4. priyanka says:

    can we put a pdf into the same jsp file using the ajax like here you have done for text file….

  5. ANU says:

    VEARY UESFULL THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Hibernate Spring Struts
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2018 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.