//
本站原創:www.drise.cn
作者:drise1
QQ:271728967
//
接上面的.
function Senddata(method,url,ReturnValue,Action){ //保存數據
xmlhttp.open(method,url,true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Cache-Control","no-cache"); //不緩存
if(ReturnValue !=null){
xmlhttp.onreadystatechange=ReturnValue;
}
xmlhttp.send(null);
if(Action == 'mkdir') //如果是創建文件夾就刷新窗口
{
window.location.reload();
}
}
function ReturnValue(){//返回值
if(xmlhttp.readystate != 4 || xmlhttp.status != 200){
document.getElementById("t0").innerHTML="<div id='info' style='position:absolute; height:20px; z-index:1; left: 245px; top: 121px;display:block'>正在發送...</div>";
}
if( xmlhttp.readystate == 4 || xmlhttp.status == 200 ){
document.getElementById("t0").innerHTML="<div id='info' style='position:absolute; height:20px; z-index:1; left: 245px; top: 121px;display:block '>"+xmlhttp.responseText+"</div>";
}
setInterval("func()",3000);//設置3000秒延遲
}
function func(){
ob=document.getElementById('info');
ob.style.display = 'none';
}
下面為刪除
function del(obj){
if(confirm("確實要刪除\""+obj+"\"嗎?","","")){
CreateAjax();
var Delurl="rename.php?path="+encodeURI(obj.replace("/","\/"))+"&action=del&rd="+Math.random();
xmlhttp.open("GET",Delurl,true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Cache-Control","no-cache");
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readystate == 4 || xmlhttp.status == 200){
var value=xmlhttp.responseText;
if( value =='t' ){
document.getElementById(obj).style.display="none";
}else if( value =='fo'){
alert("操作失敗,請查看權限或文件夾不為空!foss!");
}else if( value =="ff"){
alert("操作失敗,請查看權限!");
}else{
alert("操作失敗,請查看權限或文件夾不為空!!");
}
}
}
xmlhttp.send(null);
}
}