气温气象预报远程控制获得方式
摘要: 气温气象预报远程控制获得方式今日网编共享资源一篇怎样获得远程控制气温的JS编码远程控制启用气温的JS软件var xmlHttp = false;try { xmlHttp = new ActiveXObject( Msxml2.XMLHTTP } catch (e) { try { ...
远程控制启用气温的JS软件
var xmlHttp = false;
try {
xmlHttp = new ActiveXObject( Msxml2.XMLHTTP
} catch (e) {
try {
xmlHttp = new ActiveXObject( Microsoft.XMLHTTP
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp typeof XMLHttpRequest != undefined ) {
xmlHttp = new XMLHttpRequest();
} function callServer() {
xmlHttp.open( GET , /xg.asp , true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
}
function updatePage(id,divid) {
if (xmlHttp.readyState 4) {
test1.innerHTML= div > }
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
test1.innerHTML=response;
}
} 下边是XG.ASP网页页面一部分 % Response.charset = utf-8 %
%function getHTTPPage(url)
dim Http
set Http=server.createobject( MSXML2.XMLHTTP )
Http.open get ,url,false
Http.send()
if Http.readystate 4 then
exit function
end if
getHTTPPage=BytesToBSTR(Http.responseBody, utf-8 )
xmlhttp.setRequestHeader( charset , utf-8
set http=nothing
if err.number 0 then err.Clear
end function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject( adodb.stream )
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function Dim Url,Html
Url= data/ 这儿是JS一部分
Html = getHTTPPage(Url)
Response.write Html
%