Practically everything happens through an XMLHttpRequest object. The first step is creating one. Most browsers support new XMLHttpRequest() but older versions of internet explorer (technically msxml libraries used by internet explorer) required creating an ActiveXObject. To handle both the current method and two older msxml methods, as well as browsers that don
A consideration with using php (or any other server-side language) is that the server is probably set to send headers saying php output is html. With Ajax you may sometimes be using html, but often xml or plain text is more appropriate. For those cases, you should send the appropriate header for the format of the response. In php, this is done with the header function. other server-side languages have similar functions.
The header needed is Content-Type. For xml you want the value set to text/xml, and for plain text text/plain. it
Handling the Response
No Comments for this page.