I have some code that looks like this:
Set xmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlHttp.Open "Get", myRSSfile, false
xmlHttp.Send()
myXML = xmlHtt开发者_如何转开发p.ResponseText
Set xmlResponse = Server.CreateObject("MSXML2.DomDocument")
xmlResponse.async = false
xmlResponse.LoadXml(myXML)
Set xmlHttp = Nothing
Set objLst = xmlResponse.getElementsByTagName("item")
Set xmlResponse = Nothing
NoOfHeadlines = objLst.length - 1
Response.Write NoOfHeadlines
This worked find on my development server. When I moved it over to a staging server (which I have no control over, and no nothing about), NoOfHeadlines returns 0. It seems obvious to me that DomDocument is not working the way its supposed to. Is this a version issue? How do I find out what version of DomDocument is on the staging server? Is there another possibility?
The problem was
xmlHttp.Open "Get", myRSSfile, false
should be
xmlHttp.Open "GET", myRSSfile, false
精彩评论