不用jq的异步数据获取

  function LoadData(url, sign) {             var message = "";             if (sign == "quxiao") {                 message = '正在对各个子系统逐一取消授权,请稍后。。。';              }             else {                 message = '正在对各个子系统逐一授权,请稍后。。。';             }

            $.blockUI({                 message: '<div class="loadingDiv"><table><tr><td><img src="image/Loading1.gif" /></td></tr><tr><td>' + message + '</td></tr></table></div>',                 //                css: { color: 'yellow', border: '3px solid #aaa',                 //                    backgroundColor: '#CC3300'                 //                },                 overlayCSS: {                     backgroundColor: '#A6A6A6'                 }             });             url = url.replace(/undefined/g, "");             var xh = new ActiveXObject("Microsoft.XMLHTTP");             xh.onreadystatechange = function () {                 if (xh.readyState == 4) {                     if (xh.status == 200) {                         if (xh.responseText != "") {                             alert(xh.responseText);                             $.unblockUI();                             window.location.href = 'Default.aspx';                         }                     }                 }             }

            xh.open("GET", url, true);             xh.send();         }

posted @ 2014-11-17 14:49  尹成亮  阅读(381)  评论(0编辑  收藏  举报