Get all updates of Java4s
Follow Us: Email 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

  ♦ About Author ♦

Java4s_Author
sivateja@java4s.com
Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.

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
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
Upcoming
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

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