/**
* Set StatId
*/
Function setStatId (){
Var cookieId = genStatId ();
SetCookie (statIdName, cookieId, 365 );
}
/**
* Get StatId
*/
Function getStatId (){
Var statId = getCookie (statIdName );
If (statId! = Null & statId. length> 0 ){
Return statId;
} Else {
SetStatId ();
Return getStatId ();
}
}
/**
* Obtain UA
*/
Function getUA (){
Var ua = navigator. userAgent;
'If (ua. length> 250 ){
Ua = ua. substring (0,250 );
}
Return ua;
}
/**
* Obtain the browser type
*/
Function getBrower (){
Var ua = getUA ();
If (ua. indexOf ("Maxthon ")! =-1 ){
Return "Maxthon ";
} Else if (ua. indexOf ("MSIE ")! =-1 ){
Return "MSIE ";
} Else if (ua. indexOf ("Firefox ")! =-1 ){
Return "Firefox ";
} Else if (ua. indexOf ("Chrome ")! =-1 ){
Return "Chrome ";
} Else if (ua. indexOf ("Opera ")! =-1 ){
Return "Opera ";
} Else if (ua. indexOf ("Safari ")! =-1 ){
Return "Safari ";
} Else {
Return "ot ";
}
}
/**
* Obtain the browser Language
*/
Function getBrowerLanguage (){
Var lang = navigator. browserLanguage;
Return lang! = Null & lang. length> 0? Lang :"";
}
/**
* Obtain the Operating System
*/
Function getPlatform (){
Return navigator. platform;
}
/**
* Obtain the page title
*/
Function getPageTitle (){
Return document. title;
}
/**
* Create a form
*
* @ Return
*/
Function createSubmitForm (){
Var frm = document. createElement ("form ");
Document. body. appendChild (frm );
Frm. method = "POST ";
Return frm;
}
/**
* Create an element for form
*
* @ Param inputForm
* @ Param elementName
* @ Param elementValue
* @ Return
*/
Function createFormElement (frmInput, elementName, elementValue ){
Var element = document. createElement ("input ");
Element. setAttribute ("id", elementName );
Element. setAttribute ("name", elementName );
Element. setAttribute ("type", "hidden ");
Element. setAttribute ("value", elementValue );
FrmInput. appendChild (element );
Return element;
}
/**
* Construct an XMLHttpRequest object
*
* @ Return
*/
Function createXMLHttpRequest (){
If (window. ActiveXObject ){
XmlHttp = new ActiveXObject ('Microsoft. xmlhttp ');
} Else if (window. XMLHttpRequest ){
XmlHttp = new XMLHttpRequest ();
}
}
/**
* The url specifies the jump page. data is the data to be post. Func is similar to function pointer.
*
* @ Param url
* @ Param data
* @ Param func
* @ Return
*/
Function AjaxPost (url, data, func ){
Var httpRequest = createHttpRequest ();
If (httpRequest ){
HttpRequest. open ("POST", url, true );
HttpRequest. setRequestHeader ("content-length", data. length );
HttpRequest. setRequestHeader ("Content-Type", "application/x-www-form-urlencoded ");
HttpRequest. send (data );
HttpRequest. onreadystatechange = function (){
If (httpRequest. readyState = 4 ){
Try {
If (httpRequest. status = 200 ){
If (func ){
// You can call the desired function here
Func (httpRequest. responseText );
}
}
} Catch (e ){
Alert ("Error XMLHttpRequest! ");
}
}
}
} Else {
Alert ("Error initializing XMLHttpRequest! ");
}
}
Function vlstatInitLE (vlch, vlch, vlch2, vlch3 ){
Var p;
Var vlstatCH = vlch! = Null & vlch. length> 0? Vlch :"";
Var vlstatpattern = vldid! = Null & vlch1.length> 0? Vldid :"";
Var vlstatCH2 = vlch2! = Null & vlch2.length> 0? Vlch2 :"";
Var vlstatCH3 = vlch3! = Null & vlch3.length> 0? Vlch3 :"";
Var vlstatCookieId = getStatId ();
Var vlstatUA = encodeURIComponent (getUA ());
Var vlstatIPAddress = document. localName;
Var vlstatREFURL = encodeURIComponent (document. referrer );
Var vlstatURL = encodeURIComponent (document. URL );
Var vlstatScreenX = screen. width;
Var vlstatScreenY = screen. height;
Var vlstatOS = getPlatform ();
Var vlstatBrower = getBrower ();
Var vlstatBrowerLanguage = getBrowerLanguage ();
Var vlstatPageTitle = encodeURIComponent (getPageTitle ());
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.