jquery的这段代码转换成js怎么做,谢谢
functioncheckDIdMore(){//异步验证数据集中器代码是否重复createRequest();varid=$(":input[name=dataBean...
function checkDIdMore(){//异步验证数据集中器代码是否重复
createRequest();
var id=$(":input[name=dataBean.Code]").val();
var cid=$(":input[name=dataBean.Id]").val();
id=id+cid;
var url="<%=basePath %>/data/checkData.action?dataBean.Id="+id;
request.open("GET", url, true);
request.onreadystatechange = rollbackId;
request.send(null);
}
function rollbackId(){//回调方法
if (request.readyState == 4) {
if (request.status == 200) {
var response = request.responseText;
document.getElementById("div1").innerHTML=response;
} else
alert("网页错误,请重试");
}
} 展开
createRequest();
var id=$(":input[name=dataBean.Code]").val();
var cid=$(":input[name=dataBean.Id]").val();
id=id+cid;
var url="<%=basePath %>/data/checkData.action?dataBean.Id="+id;
request.open("GET", url, true);
request.onreadystatechange = rollbackId;
request.send(null);
}
function rollbackId(){//回调方法
if (request.readyState == 4) {
if (request.status == 200) {
var response = request.responseText;
document.getElementById("div1").innerHTML=response;
} else
alert("网页错误,请重试");
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询