1. function _post(url,data,cb){
    2. var xmlHttp,
    3. isIE = false;
    4. if(window.ActiveXObject){
    5. // xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    6. xmlHttp = new XDomainRequest();
    7. isIE = true;
    8. }else{
    9. xmlHttp = new XMLHttpRequest();
    10. }
    11. xmlHttp.onreadystatechange = function (){
    12. if(xmlHttp.readyState == 4) {
    13. if(xmlHttp.status == 200) {
    14. cb && cb(responseText);
    15. }
    16. }
    17. };
    18. xmlHttp.open("POST", url);
    19. xmlHttp.withCredentials = true;
    20. if(isIE){
    21. xmlHttp.contentType = 'application/json'
    22. }else{
    23. xmlHttp.setRequestHeader('Content-Type','application/json');
    24. }
    25. xmlHttp.send(JSON.stringify(data));
    26. }