php中的ajax为什么失效,PHP Ajax函数在Win 2003 machin中不起作用

function fun_LeaveLength_JS_G(dG1,dG2)

{

err2=true;

G_EmpIdFromJS=document.frmLeaveApp.txtG_EmpId.value;

G_PL_CountJS=document.frmLeaveApp.txt_PLCount.value;

PLAvailabe_JS= document.frmLeaveApp.PL_available.value;

CLAvailabe_JS=document.frmLeaveApp.CL_available.value;

LWPAvailabe_JS=document.frmLeaveApp.LWP_available.value;

MLAvailabe_JS=document.frmLeaveApp.ML_available.value;

COMPAvailabe_JS=document.frmLeaveApp.COMP_available.value;

FromHomeAvailabe_JS=document.frmLeaveApp.txt4mHome_available.value;

LeaveType_JS=document.frmLeaveApp.sltLeaveType.value;

alert(PLAvailabe_JS+\" \"+ CLAvailabe_JS +\" \"+ LWPAvailabe_JS +\" \"+ MLAvailabe_JS +\" \"+ COMPAvailabe_JS +\" \"+ FromHomeAvailabe_JS + \" \"+ LeaveType_JS);

if (dG1==\"\" || dG2==\"\")

{

return;

}

FromDate_G= dG1;

ToDate_G=dG2;

var d = new Date();

//if(str==\"\")

{

if (window.XMLHttpRequest)

{

xmlhttp2=new XMLHttpRequest();

}

else

{

xmlhttp2=new ActiveXObject(\"Microsoft.XMLHTTP\");

}

xmlhttp2.onreadystatechange=function()

{

alert(\"Before response from the AJAX\");

if (xmlhttp2.readyState==4 && xmlhttp2.status==200)

{

document.frmLeaveApp.txtLeaveLeangth.value=xmlhttp2.responseText;

alert(\"in ajax fileError 2 is \"+err2);

alert(\"Ajax result is : \"+xmlhttp2.responseText);

//LeaveLength_JS=xmlhttp2.responseText();

if(xmlhttp2.responseText==1)

{

err2=true;

alert(\"when ajax result is 1 error 2 is \"+err2);

LeaveLength_JS=xmlhttp2.responseText();

}

if(xmlhttp2.responseText==0)

{

err2=false;// allow to apply leave

alert(\"when ajax result is 0 error 2 is \"+err2);

}

else

{

err2=true;

alert(\"when ajax result is other then error 2 is \"+err2);

Alert(\"This is developer error. Please Inform to System admin\");

}

}

}

xmlhttp2.open(\"GET\",\"http://localhost/MyProject/LeaveLength_Ajax.php?_Get_FromDate=\"+FromDate_G+\"&_Get_ToDate=\"+ToDate_G+\"&PLAvailabe_JS=\"+PLAvailabe_JS +\"&CLAvailabe_JS=\"+CLAvailabe_JS +\"&LWPAvailabe_JS=\"+LWPAvailabe_JS+\"&MLAvailabe_JS=\"+MLAvailabe_JS+\"&COMPAvailabe_JS=\"+COMPAvailabe_JS+\"&FromHomeAvailabe_JS=\"+FromHomeAvailabe_JS +\"&LeaveType_JS=\"+LeaveType_JS,true);

xmlhttp2.send();

}

alert(\"At the end Error 2 is \"+err2);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值