XMLHTTP: Website Super Bond

zhaozj2021-02-08  236

Guide: The article describes how to communicate with the server side with XMLHTTP and introduce some specific applications.

XML introduction 28: XMLHTTP: Website Super binder

Translation: Batman

Introduction

Many ASP developers want to use Microsoft to support XML in their own website.

New features. Among them, some people find that I can use XML to decorate the website, but if only

If you use XMLDOM, you will lose some more important things. After all, XML is used

As an online data performance and the image exchange of data exchange. Although it can be very satisfied with XML

Draw your data, but developers have to use CGI to make browser and servers.

Data exchange unless you use an XML document using the browser and the client.

Of course, the CGI can be completely competent from the perspective of conveying information, but if if it is to come and XML

Let XML lose a lot of own use. Fortunately, Microsoft provides a more

Effective methods to transmit XML, although this method is largely not paid attention to.

There is a series of objects in the MSXML interpreter package provided by Microsoft, maybe no one will pay attention to it.

XMLHTTPCONNECTION object. In short, it allows you to open a HTTP connection on the server.

Send some data and retrieve some data. And all this can be implemented in a few pieces of scripts.

Using XMLHTTP objects is usually XML data exchange, but other formatted data is also allowed.

Application in business procedures

This type of exchange type is a text string to the server that the client sends an XML format to the server.

The server then loads this string into an XMLDOM object and explains it, then return a paragraph.

HTML gives the client, or another XML code gives the client's browser to explain itself.

In this way, it is very effective for the delivery of information, especially when you are using

DHTML allows you to dynamically display according to the return information.

Examples are as follows (only IE5 is installed in the client and the server)

<%

IF (Request.serverVariables ("request_method") == "post")

{

Var Req = Server.createObject ("Microsoft.xmLdom");

Req.async = false;

Req.Load (Request);

IF (Req.Documentelement.nodeName == "TimeSheet")

{

// Some processing is performed casually. . .

.....

Response.write ("

TimeSheet Updated! " Req.DocumentElement.Text "");

}

}

Else

{%>

The response will be put in here