<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
</Head>
<Script language = "JavaScript" src = "jquery. js"> </SCRIPT>
<Script language = "JavaScript">
Function checkqqonline (){
VaR QQ = Document. getelementbyid ("QQ"). value;
VaR data;
Data = '<? XML version = "1.0" encoding = "UTF-8"?> ';
Data = Data + '<soap: envelope xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: XSD = "http://www.w3.org/2001/XMLSchema" xmlns: Soap = "http://schemas.xmlsoap.org/soap/envelope/"> ';
Data = Data + '<soap: Body> ';
Data = Data + '<qqcheckonline xmlns = "http://WebXml.com.cn/"> ';
Data = Data + '<qqcode>' + QQ + '</qqcode> ';
Data = Data + '</qqcheckonline> ';
Data = Data + '</soap: Body> ';
Data = Data + '</soap: envelope> ';
VaR url = "http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx ";
VaR XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
XMLHTTP. Open ("Post", URL, false );
XMLHTTP. setRequestHeader ("Content-Type", "text/XML; charset = UTF-8 ");
XMLHTTP. setRequestHeader ("Content-Length", Data. Length );
XMLHTTP. setRequestHeader ("host", "webservice.webxml.com.cn ");
XMLHTTP. setRequestHeader ("soapaction", "http://WebXml.com.cn/qqCheckOnline ");
XMLHTTP. Send (data );
VaR x = XMLHTTP. responsexml;
VaR temp = x. childnodes [1]. text;
VaR MSG = "";
If (temp = "Y "){
MSG = "online ";
} Else if (temp = "N "){
MSG = "offline or invisible! ";
} Else if (temp = "e "){
Alert ("Incorrect QQ number ");
}
Alert ("query QQ number:" + QQ + "Current status:" + MSG );
}
Function checkmobile (){
VaR mobile = Document. getelementbyid ("mobile"). value;
VaR data;
Data = '<? XML version = "1.0" encoding = "UTF-8"?> ';
Data = Data + '<soap: envelope xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: XSD = "http://www.w3.org/2001/XMLSchema" xmlns: Soap = "http://schemas.xmlsoap.org/soap/envelope/"> ';
Data = Data + '<soap: Body> ';
Data = Data + '<getmobilecodeinfo xmlns = "http://WebXml.com.cn/"> ';
Data = Data + '<mobilecode>' + mobile + '</mobilecode> ';
Data = Data + '<userid>' + "" + '</userid> ';
Data = Data + '</getmobilecodeinfo> ';
Data = Data + '</soap: Body> ';
Data = Data + '</soap: envelope> ';
VaR url = "http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx? OP = getmobilecodeinfo ";
VaR XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
XMLHTTP. Open ("Post", URL, false );
XMLHTTP. setRequestHeader ("Content-Type", "text/XML; charset = UTF-8 ");
XMLHTTP. setRequestHeader ("Content-Length", Data. Length );
XMLHTTP. setRequestHeader ("host", "webservice.webxml.com.cn ");
XMLHTTP. setRequestHeader ("soapaction", "http://WebXml.com.cn/getMobileCodeInfo ");
XMLHTTP. Send (data );
VaR x = XMLHTTP. responsexml;
VaR temp = x. childnodes [1]. text;
Alert (temp );
}
Function qqonline (qq ){
VaR data;
Data = '<? XML version = "1.0" encoding = "UTF-8"?> ';
Data = Data + '<soap: envelope xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: XSD = "http://www.w3.org/2001/XMLSchema" xmlns: Soap = "http://schemas.xmlsoap.org/soap/envelope/"> ';
Data = Data + '<soap: Body> ';
Data = Data + '<qqcheckonline xmlns = "http://WebXml.com.cn/"> ';
Data = Data + '<qqcode>' + QQ + '</qqcode> ';
Data = Data + '</qqcheckonline> ';
Data = Data + '</soap: Body> ';
Data = Data + '</soap: envelope> ';
VaR url = "http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx ";
VaR XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
XMLHTTP. Open ("Post", URL, false );
XMLHTTP. setRequestHeader ("Content-Type", "text/XML; charset = UTF-8 ");
XMLHTTP. setRequestHeader ("Content-Length", Data. Length );
XMLHTTP. setRequestHeader ("host", "webservice.webxml.com.cn ");
XMLHTTP. setRequestHeader ("soapaction", "http://WebXml.com.cn/qqCheckOnline ");
XMLHTTP. Send (data );
VaR x = XMLHTTP. responsexml;
VaR temp = x. childnodes [1]. text;
VaR MSG = "";
If (temp = "Y "){
MSG = "online ";
} Else if (temp = "N "){
MSG = "offline or invisible! ";
} Else if (temp = "e "){
Alert ("Incorrect QQ number ");
}
Return QQ + MSG;
}
</SCRIPT>
<Script language = "JavaScript">
$ (Document). Ready (function (){
Document. getelementbyid ("lab1"). innertext = qqonline (715733768 );
Document. getelementbyid ("lab2"). innertext = qqonline (511021266 );
});
</SCRIPT>
<Body>
QQ number: <input type = "text" name = "QQ" id = "QQ"/> <input type = "button" name = "Search" value = "query" onclick = "checkqqonline () "/> <br/>
Mobile phone number: <input type = "text" name = "mobile" id = "mobile"/> <input type = "button" name = "Search" value = "query" onclick = "checkmobile () "/> <br/>
<Label id = "lab1"> </label> <br/>
<Label id = "lab2"> </label>
</Body>
</Html>