为什么用这段asp读取不到远程xml内容?
xml内容如下:
<?xml version="1.0" encoding="BIG5" ?>
- <root>
<channel channelSTREAM="" channelSTREAM2="" trailerStream="http://grm.cdn.hinet.net/media/hich/playmms.asp?mmsurl=mms://wms.media.hinet.net/WebLive/NexTV/105/105.wmv?WLIVE4797E1AE-16FE-4BC0-98A7-2BAA2F967FC4" />
</root>
1.我用以下的asp代码:
<%
dim XMLMorntekDocument
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET","网页地址",False
http.send
Set XMLMorntekDocument=Server.CreateObject("Microsoft.XMLDOM")
XMLMorntekDocument.Async=False
XMLMorntekDocument.ValidateOnParse=False
XMLMorntekDocument.Load(http.ResponseXML)
price = XMLMorntekDocument.selectSingleNode("//channel").getAttribute("channelSTREAM")
response.write price
Set http=Nothing
Set XMLMorntekDocument=Nothing
%>
怎么读取不到channelSTREAM的值?
2.我用js可以读取到,但是每次打开时会提示“该页将访问控制范围以外的页面”类似的提示,怎么让他不提示呢?
js代码如下可以取到值:
<SCRIPT LANGUAGE="JavaScript" runnat=server>
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET","网页地址",false);
xmlhttp.send();
//alert((xmlhttp.responseXML.selectSingleNode("//channel")).getAttribute("channelSTREAM"));
//window.location=(xmlhttp.responseXML.selectSingleNode("//channel")).getAttribute("channelSTREAM");
document.write((xmlhttp.responseXML.selectSingleNode("//channel")).getAttribute("channelSTREAM"));
//window.location="ptl.asp?"+(xmlhttp.responseXML.selectSingleNode("//channel")).getAttribute("channelSTREAM");
</script>