tags:

views:

63

answers:

5

I would really appreciate If anyone can explain methe following:

document.getElementById("txtHint2").innerHTML=xmlHttp.responseText;

I understand that result (right side after equal sign) will be written within div tag in this case...But what is this RESPONSETEXT actually?

I have html calling some *.js. In this I have url to php. In php is command connect to database and give results after my query.

So result of this query sholud be related to =responseText ...

I am confused and not so familiar about this ...Please help me!!!

A: 

It contains the content from the URL you requested using the XMLHttpRequest object.

Jerome
A: 

The object xmlHttp has the property responseText that is the response of your XML HTTP Request ("ajax" return). It's like when you load a page in a browser and you get your page.


This object has many properties, like:

responseText: Returns the response data as a string

responseXML: Returns the response data as XML data

Referece: http://www.w3schools.com/dom/default.asp.

Topera
A: 

xmlHttp.responseText is the body of the response from the server. It is whatever was sent back from the server based on the request (specified in the xmlHttp object). It could be a simple string of text, or a snippet of HTML, or JSON to be parsed and used by your code.

Valera
A: 

the requested url will generate an output(text/html). This output is sent to the client(requested page) through xmlHttp.responseText;

You may also get xml as an output, then you need to use xmlHttp.responseXML; you need to parse this and use it in your application..

manidhar mulaparthi