21,891
社区成员
发帖
与我相关
我的任务
分享
//检测预定信息输入数据合法性
function checkAddInfo()
{
//此处省略若干无故障代码!!
var getURL = "form_check.php?timeCheck=true&date="+sDate+"&room="+room;
sqlDate = checkDestineInfo(getURL);
if(sqlDate == "yes")
{
return true;
}
arrc = sqlDate.split("&&");
arrNum = arrc.length;
alert(sqlDate);//此处的框框为第二个!!
while(arrNum != 0)
{
//由于代码过长,以下代码省略,以下代码无故障!!
}
}
//预定冲突验证
function checkDestineInfo(getURL)
{
definXmlHttp();
var sqlDate = "";
if(xmlHttp != null)
{
xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState == 4){sqlDate = xmlHttp.responseText;}};
xmlHttp.open("GET", getURL ,true);
xmlHttp.send(null);
alert(sqlDate);//此处的框框为第一个
return sqlDate;
}
else
{
alert("连接错误");
}
return sqlDate;
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState == 4){
if (xmlHttp.status == 200){
var response = xmlHttp.responseText;
alert(response) //alert 一下
}else if (xmlHttp.status == 404){
alert("Page could not found ");
}else{
alert("Error: status code is " + xmlHttp.status);
}
}
}function checkAddInfo()
{
//此处省略若干无故障代码!!
var getURL = "form_check.php?timeCheck=true&date="+sDate+"&room="+room;
checkDestineInfo(getURL);
}
//预定冲突验证
function checkDestineInfo(getURL)
{
definXmlHttp();
var sqlDate = "";
if(xmlHttp != null)
{
xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState == 4){handler(xmlHttp.responseText);}};
xmlHttp.open("GET", getURL ,true);
xmlHttp.send(null);
// alert(sqlDate);//此处的框框为第一个
// return sqlDate;
}
else
{
alert("连接错误");
}
//return sqlDate;
}
function handler(sqlDate){
if(sqlDate == "yes")
{
return true;
}
var arrc = sqlDate.split("&&");
var arrNum = arrc.length;
alert(sqlDate);//此处的框框为第二个!!
while(arrNum != 0)
{
//由于代码过长,以下代码省略,以下代码无故障!!
}
}