OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XML HTTP and HTTP...

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: XML HTTP and HTTP...
  • From: "Anil_R" <Anil_R@satyam.com>
  • Date: Tue, 7 Feb 2006 20:20:19 +0530
  • Importance: normal
  • Priority: normal
  • Thread-index: AcYr9c1aJtsOtEXkQgS4Ll9kX+VjNw==
  • Thread-topic: XML HTTP and HTTP...

Dear All,

 

Can anybody tell me the difference between XHTTP and the usual http?

What is the difference between the following two codes?? Which is better and preferred??

In both the cases I am sending a request from the client to the server and the server returns an XML doc. The XML Doc is a dynamic Doc created by a ASPX page.

 

Code 1. Here a HTTP Request is sent from the Client to the Server and loads a XML Dom. This is then used to populate data into a ComboBox..

oXml = new ActiveXObject("Microsoft.XMLDOM");

oXml.async = true;

try

{

window.document.focus();

oXml.load("ABC.aspx?Querystring=S”);

oXml.onreadystatechange = funPopulateSel;

            }

            catch(e)

            {

                        alert(e);

            }

 

 

Code 2. Here is another code where in an xhttp request is sent from client to server. The response is loaded in to a XML Dom and is used to populate data into a combo box.

 

 

url="ABC.aspx?Querystring=S”

xmlhttp.open("GET",url,true);

xmlhttp.onreadystatechange=function() {

if (xmlhttp.readyState==4)

{

oXml = new ActiveXObject("Microsoft.XMLDOM");

oXml.load(xmlhttp.responseText);

oXml.onreadystatechange = funPopulateSel;

}

 

 

Which is better??

I prefer the first one because only one object is created J

The second case is how a typical AJAX works…may be the response is not an XML.

 

Thanks And With Regards,

Anil R.Nair

 

DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated..





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS