Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. function loadXMLDocAsyncTest(url,readyFunc,postData) {
  2. if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
  3. xmlhttp=new XMLHttpRequest();
  4. } else {// code for IE6, IE5
  5. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  6. }
  7. xmlhttp.open(!!postData?"POST":"GET", url, true);
  8. xmlhttp.onreadystatechange = function() {
  9. readyFunc(xmlhttp);
  10. };
  11.  
  12. if (!!postData && typeof postData == "string")
  13. xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  14.  
  15. xmlhttp.send(!!postData?postData:null);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement