Get all updates of Java4s
Newsletter

Ajax Server Response, responseText and responseXML

Ajax »on Aug 26, 2011 { 4 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

Comments

4 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….

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Spring-Boot-tutorials Hibernate tutorials Spring tutorials Struts tutorials Servlets tutorials Ajax tutorials Log4j tutorials jQuery tutorials Json tutorials Core Java tutorials Web Services tutorials AngularJs tutorials
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Contact | About Us | Privacy Policy | Advertise With Us

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