var docEle = function() { return document.getElementById(arguments[0]) || false; } function $(id){ return document.getElementById(id); } function openNewDiv(_id) { var m = "mask"; if (docEle(_id)) document.removeChild(docEle(_id)); if (docEle(m)) document.removeChild(docEle(m)); // 新激活图层 var newDiv = document.createElement("div"); newDiv.id = _id; newDiv.style.position = "absolute"; newDiv.style.zIndex = "9999"; newDiv.style.width = "300px"; newDiv.style.height = "200px"; newDiv.style.top = "100px"; newDiv.style.left = (parseInt(document.body.scrollWidth) - 300) / 2 + "px"; // 屏幕居中 newDiv.style.background = "#EFEFEF"; newDiv.style.border = "1px solid #860001"; newDiv.style.padding = "5px"; newDiv.innerHTML = "" document.body.appendChild(newDiv); // mask图层 var newMask = document.createElement("div"); newMask.id = m; newMask.style.position = "absolute"; newMask.style.zIndex = "1"; newMask.style.width = document.body.scrollWidth + "px"; newMask.style.height = document.body.scrollHeight + "px"; newMask.style.top = "0px"; newMask.style.left = "0px"; newMask.style.background = "#000"; newMask.style.filter = "alpha(opacity=40)"; newMask.style.opacity = "0.40"; document.body.appendChild(newMask); // 关闭mask和新图层 // var saveButton = document.createElement("a"); // saveButton.href = "#"; // saveButton.innerHTML = "确定"; // saveButton.className="regular"; // saveButton.onclick = function() { // // //document.body.removeChild(docEle(_id)); // //document.body.removeChild(docEle(m)); // //return false; // } // newDiv.appendChild(saveButton); // // //newDiv.innerHTML += "      "; // // var cancelButton = document.createElement("a"); // cancelButton.href = "#"; // cancelButton.innerHTML = "取消"; // cancelButton.className="regular"; // cancelButton.onclick = function() { // document.body.removeChild(docEle(_id)); // document.body.removeChild(docEle(m)); // // return false; // } // newDiv.appendChild(cancelButton); } function addSeaExportUser(){ var ck_modify = $("isModify"); if(ck_modify.checked){ var urlVal = "../AuditProcess/AuditService.aspx?handle=modify&bsno="+$("h_id").value+"&val="+newGuid(); alert(urlVal); var loader = dhtmlxAjax.getSync(urlVal);alert(loader); var loadVal = loader.xmlDoc.responseText; }else{ alert(222); } document.body.removeChild(docEle("dvAmend")); document.body.removeChild(docEle("mask")); } //获取GUID function newGuid() { var guid = ""; for (var i = 1; i <= 32; i++){ var n = Math.floor(Math.random()*16.0).toString(16); guid += n; if((i==8)||(i==12)||(i==16)||(i==20)) guid += "-"; } return guid.toUpperCase(); }