Home >Java >javaTutorial >Java servlet ajax

Java servlet ajax

巴扎黑
巴扎黑Original
2017-06-23 15:26:411334browse

AJAX is the art of exchanging data with a server and updating parts of a web page without reloading the entire page.

AJAX = Asynchronous JavaScript and XML.

AJAX is a technology for creating fast, dynamic web pages.


## function lnTest() {

var ur_loginName = document.getElementById("ur_loginName").value;
var login = document.getElementById("login" );
var id = "${sessionScope.user.ur_id}";
var ymsz = /^[A-Za-z0-9]+$/;
var loginname = document.getElementById( "loginname").value;
if(loginname==ur_loginName){
return true;
}else if (kong.test(ur_loginName)) {
login.style.color = "red ";
                                                                                                                     # xml.open("get", "AJAXServlet.do", true);
xml.setRequestHeader("name", ur_loginName);
xml.setRequestHeader("ur_id", id);
x ml .send(null);
                     ;
            var login = document.getElementById( "login");
if (msg == 1) {
Login.style.color = "red";
Login.innerhtml = "× The user name has been used";
Return false; nerHTML = " √ This username can be used";
                                              return true;
                                                           Login.style.color = "red";
Login.innerHTML = " × The account format is not Correct ":
Return false;
}
}
## Use ajax to dynamically update the username when clicking the Input box to determine whether the input user name exists


The above is the detailed content of Java servlet ajax. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn