English 中文(简体)
Mxml2.DOMDocument与Msxml2.XMLHTTP之间的差异
原标题:Difference between Msxml2.DOMDocument and Msxml2.XMLHTTP

区别在于:

Msxml2.DOMDocument
Msxml2.XMLHTTP

当然,另一个问题是,谁能最好地为我服务,如下文所述?

上下文是这样的 - 我有代码可以多次调用来检索网页。 我正在寻找此任务最有效的对象。 例如, 例如 :

Dim oXmlHttp : Set oXmlHttp = CreateObject("MSXML2.XMLHTTP")

oXmlHttp.Open "GET", sUri, False
oXmlHttp.Send
If Err Then
    getWebPage = "ERROR - could not get the source text of the webpage."
    Exit Function
End If
sResponse = oXmlHttp.responseBody

如果我用以下方法创建一个对象,这似乎同样有效:

Dim oXmlHttp : Set oXmlHttp = CreateObject("MSXML2.XMLHTTP")

有没有人能解释或指给我一个明确概述其中每一种差异(和预期用途)的提法?

最佳回答

如果您想要了解更多关于 MSXML 的信息, 这些链接可能会帮助 :

简言之,XMLHTTP 被用于检索信息,而DOMDocument 被用于结构和分析信息。

本页解释得更好:

DOMDocument “ 代表 XML DOM 树的顶端节点。” 而 XMLHTTP “ 客户端协议支持与 HTTP 服务器的通信 。

问题回答

暂无回答




相关问题
XMLHttpRequest used to find quicker server

I have a situation where my website needs to quickly retrieve data from my server via AJAX. My website runs on port 80, serving normal web pages. I normally run my AJAX server on port 8001 (I use ...

AJAX readystate

This script sends a request to a Apache web server every 500ms to retrieve an XML document using AJAX. This script functioned correctly on all the browsers listed below until recently. Now the ...

Is nested XMLHttpRequests with multiple closures a good idea?

I have a Greasemonkey script which operates on a search results page at a video site. The function of the script is to take a javascript link that opens a new window with a flash player, jump through ...

How to emulate XMLHttpRequest client using PHP?

I m looking for an example how to emulate XMLHttpRequest client using PHP. In other words, send the request over HTTP POST message, and receive and process the callback message.

xmlHttpRequest and returned url

With help of xmlHttpRequest I make a server query. After that the server is redirecting to another page (e.g. "http://site.com/index.html;var=123") The question is - how can I get full url(side.com/...

热门标签