xmlhttp为什么没有权限?
为什么下面这段代码没有权限>????
<script language="vbscript">
dim sUrl
sUrl="http://www.90live.com/chat/news.xml"
Function streamtochar(StrStream)
set stream=CreateObject("ADODB.Stream")
stream.type=1
stream.Mode=3
stream.Open
stream.Write Strstream
stream.Position= 0
stream.Type= 2
stream.Charset="gb2312"
streamtochar= stream.ReadText
stream.Close
set stream=nothing
End Function
i = i + 1
function getContentByUrl(url)
'建立对象
set oXmlHttp = CreateObject("MSXML2.XMLHTTP")
oXmlHttp.open "GET",url,false
oXmlHttp.send
getContentByUrl = streamtochar(oXmlHttp.responseBody)
set oXmlHttp=nothing
end function
'函数,获得网站内容
function getRealContent(url)
sContent = getContentByUrl(url)
getRealContent=sContent
end function
msgbox getContentByUrl(surl)
</script>
但如果改成了asp文件却又可以:
<%
dim sUrl
sUrl="http://www.90live.com/chat/news.xml"
Function streamtochar(StrStream)
set stream=CreateObject("ADODB.Stream")
stream.type=1
stream.Mode=3
stream.Open
stream.Write Strstream
stream.Position= 0
stream.Type= 2
stream.Charset="gb2312"
streamtochar= stream.ReadText
stream.Close
set stream=nothing
End Function
i = i + 1
function getContentByUrl(url)
'建立对象
set oXmlHttp = CreateObject("MSXML2.XMLHTTP")
oXmlHttp.open "GET",url,false
oXmlHttp.send
getContentByUrl = streamtochar(oXmlHttp.responseBody)
set oXmlHttp=nothing
end function
'函数,获得网站内容
function getRealContent(url)
sContent = getContentByUrl(url)
getRealContent=sContent
end function
response.write getContentByUrl(surl)
%>
真是麻烦啊~~~怎么回事呢