ajax简单校验
function saveObj(){
var userName = document.getElementById("userName").value;
checkUserName(userName);
}
//使用ajax实现页面无刷新功能;
var xmlHttpRequest;
function createXMLHttpRequest(){
if(window.XMLHttpRequest){
xmlHttpRequest = new XMLHttpRequest();
}else if(window.ActiveXObject){
try{
xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e1){}
}
}
}
//实现用户名校验技术;
function checkUserName(userName){
createXMLHttpRequest();
var url="/sxyj/jsp/SystemUserVOAction.do?userName='"+userName+"'";
xmlHttpRequest.open("post",url);
xmlHttpRequest.onreadystatechange = checkUser;
xmlHttpRequest.send(null);
}
function checkUser(){
if(xmlHttpRequest.readyState==4){
if(xmlHttpRequest.status==200){
var user="fail";
var mess = xmlHttpRequest.responseText;
if(mess=="success"){
alert("此用户已存在");
document.getElementById("txt_Name").focus();
return;
}else{
document.f
相关文档:
jsp 缓存, html 缓存, ajax缓存,解决方法
url:http://blog.csdn.net/oklzh/archive/2009/08/14/4445722.aspx
有关页面缓存问题.这个问题上网找了好多.但发觉各种解决方法,都彼此分离,没有一篇统一的解决方法,本人近日,也遇到了页面缓存的问题,根据网上各页面缓存的解答,做了一个总结。
1.服务器端缓存的问题 ......
今天遇到了一个问题,JS不能根据Ajax返回的DataTable动态生成table,格式如下:
[Ajax.AjaxMethod()]
public DataTable GetDataTable(string tablename)
{
DataTable Table=new DataTable();
  ......
$.ajax({
type: "POST", //访问WebService使用Post方式请求
......