var pkav={
 ajax:function(){
    var xmlHttp;
    try{
      xmlHttp=new XMLHttpRequest();
   }catch (e){
     try{
        xmlHttp=new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
      }catch (e){
       try{
          xmlHttp=new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
       }
       catch (e){
          return false;
       }
     }
   }
   return xmlHttp;
 },
  req:function(url,data,method,callback){
   method=(method||&quot;&quot;).toUpperCase();
    method=method||&quot;GET&quot;;
   data=data||&quot;&quot;;
    if(url){
      var a=this.ajax();
      a.open(method,url,true);
      if(method==&quot;POST&quot;){
       a.setRequestHeader(&quot;Content-type&quot;,&quot;application/x-www-form-urlencoded&quot;);
     }
     a.onreadystatechange=function(){
        if (a.readyState==4 &amp;&amp; a.status==200)
       {
         if(callback){
           callback(a.responseText);
         }
       }
     };
      if((typeof data)==&quot;object&quot;){
        var arr=[];
       for(var i in data){
         arr.push(i+&quot;=&quot;+encodeURIComponent(data[i]));
        }
       a.send(arr.join(&quot;&amp;&quot;));
      }else{
        a.send(data||null);
     }
   }
 },
  get:function(url,callback){
   this.req(url,&quot;&quot;,&quot;GET&quot;,callback);
  },
  post:function(url,data,callback){
   this.req(url,data,&quot;POST&quot;,callback);
 }
};
if(!window.__x){
pkav.post(&quot;接口地址&quot;,&quot;POST内容&quot;,function(rs){});
pkav.get(&quot;接口地址&quot;,function(rs){});
  window.__x=1;
}