Advertisement
Guest User

Untitled

a guest
Sep 28th, 2015
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. function $POST(url,pdata,success,err){var xmlhttp;timestamp=new Date();if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4 && xmlhttp.status==200){success(xmlhttp.responseText);}else if(xmlhttp.status>500){err(1);}}
  2. xmlhttp.open("POST",url+"?type=1&ca="+timestamp.getTime(),true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.send(pdata);}
  3. function $GET(url,success,err){var xmlhttp;if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4 && xmlhttp.status==200){success(xmlhttp.responseText);}else if(xmlhttp.status>500){err(1);}}
  4. xmlhttp.open("GET",url+"&type=0&ca="+Math.random(),true);xmlhttp.send();}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement