var input_value;//要修改的备注 var input_com;//要修改的排序 var in_id;//id号 var i_id; //td的号 var flag; var sort_id; var index_content; var num=0; //var num; var url function addText(i,inid){ if(num==1)return false; var id = document.getElementById("ID"+i); input_value=id.innerHTML; in_id = inid; i_id = i; if(input_value.substring(0,1)=="<") return false; id.innerHTML=""; var addtext = ""; var addbutton = ""; id.insertAdjacentHTML("beforeEnd",addtext); id.insertAdjacentHTML("beforeEnd",addbutton);
//排序 var idd = document.getElementById("IDD"+i); input_com =idd.innerHTML; if(input_value.substring(0,1)=="<") return false; idd.innerHTML=""; var addtext_c = ""; idd.insertAdjacentHTML("beforeEnd",addtext_c); num++; }
function sort_photo(obj,inid,i){ in_id = inid; i_id = i; document.getElementById("sort_hpotos").style.display='block'; document.getElementById("sort_hpotos_content").innerHTML=obj.innerHTML; } function cancel(){ document.getElementById("sort_hpotos").style.display='none'; }
function modify(){ var getelement = document.getElementById("inputID"+i_id); input_value = getelement.value; var getelement_c = document.getElementById("inputIDD"+i_id); input_com = getelement_c.value; url = "pagecontrol.do?action=update&object=Photo&in_id="+in_id+"&in_contentT="+input_value+"&in_compositorN="+input_com; getDetail(); }
var XMLHttpReq = false; //创建XMLHttpRequest对象 function createXMLHttpRequest() { if(window.XMLHttpRequest) { //Mozilla 浏览器 XMLHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE浏览器 try { XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } }
//发送请求函数_修改 function getDetail() { createXMLHttpRequest(); XMLHttpReq.open("GET", url, true); XMLHttpReq.onreadystatechange = processResponse;//指定响应函数 XMLHttpReq.send(null); // 发送请求 } // 处理返回信息函数 function processResponse() { if (XMLHttpReq.readyState == 4) { // 判断对象状态 if (XMLHttpReq.status == 200) { // 信息已经成功返回,开始处理信息 setData(); } else { //页面不正常 window.alert("您所请求的页面有异常。"); } } } // 显示提示框 function setData(data) { num=0; var id = document.getElementById("ID"+i_id); id.innerHTML=""; id.insertAdjacentHTML("beforeEnd",input_value); //排序 var idd = document.getElementById("IDD"+i_id); idd.innerHTML=""; idd.insertAdjacentHTML("beforeEnd",input_com); }
function del(in_id){ PageForm.in_id.value=in_id; PageForm.action.value = "photoDelete"; PageForm.submit(); }
//加载部门下拉列表 function getDivDept(select){ var nextlevel = eval(select.name.substr(7,8))+1; for(var i=nextlevel;i<11;i++){ if($('div_bumen_'+i)){ $('div_bumen_'+i).innerHTML=""; } } var index = select.options(select.selectedIndex).value; index_content = select.options(select.selectedIndex).innerHTML; var divobjname = 'div_bumen_'+nextlevel; $(divobjname).innerHTML = "加载中......"; ricoSubmit(divobjname, '<%=contextroot%>/jsp/admin/photo/phototype/dropdownlist.jsp?pid='+index+'&level='+nextlevel, null, null); url = "pagecontrol.do?action=update&object=Photo&in_id="+in_id+"&in_pt_idN="+index; } //发送请求函数_修改 function getDetail2() { createXMLHttpRequest(); XMLHttpReq.open("GET", url, true); XMLHttpReq.onreadystatechange = processResponse2;//指定响应函数 XMLHttpReq.send(null); // 发送请求 } // 处理返回信息函数 function processResponse2() { if (XMLHttpReq.readyState == 4) { // 判断对象状态 if (XMLHttpReq.status == 200) { // 信息已经成功返回,开始处理信息 var idd = document.getElementById("sort_ID"+i_id); idd.innerHTML=index_content; cancel(); } else { //页面不正常 window.alert("您所请求的页面有异常。"); } } }