87,910
社区成员
发帖
与我相关
我的任务
分享
<div class="story">
<p>原先的邮箱地址:<a href="mailto:default.fu@gmail.com">default.fu@gmail.com</a></p>
<form action="../back/douser.php?act=change" method="post" target="_self">
<p>新邮箱地址:
<input name="textfield" type="text" id="textfield" onblur="javascript:check_user(this.name,this.value);" maxlength="30" style="background:#FFFFFF"/>
</p>
<p><input type="submit" name="submit" value="提交" id="submit" />
</p>
</form>
</div>
<link href="../default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../back/java.js"></script>
</head>
// javascript 脚本
//==================================
//创建 并且 全局话
function createXMLHTTP(){
var request;
var browser=navigator.appName;
//如果是IE的话,那么就执行这个:
if(browser=="Microsoft Internet Explorer"){
var arrVersions=[
"Microsoft.XMLHttp",
"MSXML2.XMLHttp",
"MSXML2.XMLHttp.4.0",
"MSXML2.XMLHttp.3.0",
"MSXML2.XMLHttp.5.0");
for(var i=0;i<arrVersions.length;i++){
try{
//从中间找一个来创建
reguest=new ActiveXObject(arrVersions[i]);
return request;
}
catch(){
}
}
}else{
//否则返回一个XMLHttpRequest对象
request=new XMLHttpRequest();
if(request.overrideMimeType){
request.overrideMimeType('text/xml');
}
return request;
}
}
var http=createXMLHttp();
//对xmlhttp对象实例化,并且全局
//======================================================
//检测用户的name email 是否存在
function check_user(name,value){
var url="../back/douser.php?act=check&";
url+=("name="+name+"&value="+value);
alert(url);
http.open("GET",url,true);
http.onReadyStateChange=ProcessHttpResponse();
http.send(null);
return;
}
//===================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="JavaScript" type="text/javascript">
// javascript 脚本
//==================================
//创建 并且 全局话
function createXMLHTTP(){
var request;
var browser=navigator.appName;
//如果是IE的话,那么就执行这个:
if(browser=="Microsoft Internet Explorer"){
var arrVersions=[
"Microsoft.XMLHttp",
"MSXML2.XMLHttp",
"MSXML2.XMLHttp.4.0",
"MSXML2.XMLHttp.3.0",
"MSXML2.XMLHttp.5.0");
for(var i=0;i<arrVersions.length;i++){
try{
//从中间找一个来创建
reguest=new ActiveXObject(arrVersions[i]);
return request;
}
catch(){
}
}
}else{
//否则返回一个XMLHttpRequest对象
request=new XMLHttpRequest();
if(request.overrideMimeType){
request.overrideMimeType('text/xml');
}
return request;
}
}
var http=createXMLHttp();
//对xmlhttp对象实例化,并且全局
//======================================================
//检测用户的name email 是否存在
function check_user(name,value){
var url="../back/douser.php?act=check&";
url+=("name="+name+"&value="+value);
alert(url);
http.open("GET",url,true);
http.onReadyStateChange=ProcessHttpResponse;
http.send(null);
return;
}
function processhttpresponse(){
if(http.readystate==4){
if(http.status==200){
var xmldocument=http.responsexml;
if(http.responsetext!=""){
document.getElementByName("check_result").style.display="";
document.getElementByName("uname").style.background="#FF0000";
document.getElementByName("check_result").innertext=http.responsetext;
}
}
}else{
alert("找不到服务器!");
}
}
//===================================================
</script>
<title>无标题文档</title>
</head>
<body>
<div class="story">
<p>原先的邮箱地址:<a href="mailto:default.fu@gmail.com">default.fu@gmail.com</a></p>
<form action="../back/douser.php?act=change" method="post" target="_self">
<p>新邮箱地址:
<input name="textfield" type="text" id="textfield" onblur="javascript:check_user(this.name,this.value);" maxlength="30" style="background:#FFFFFF"/>
</p>
<p><input type="submit" name="submit" value="提交" id="submit" />
</p>
</form>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="JavaScript" type="text/javascript">
// javascript 脚本
//==================================
//创建 并且 全局话
function createXMLHTTP(){
var request;
var browser=navigator.appName;
//如果是IE的话,那么就执行这个:
if(browser=="Microsoft Internet Explorer"){
var arrVersions=[
"Microsoft.XMLHttp",
"MSXML2.XMLHttp",
"MSXML2.XMLHttp.4.0",
"MSXML2.XMLHttp.3.0",
"MSXML2.XMLHttp.5.0");
for(var i=0;i<arrVersions.length;i++){
try{
//从中间找一个来创建
reguest=new ActiveXObject(arrVersions[i]);
return request;
}
catch(){
}
}
}else{
//否则返回一个XMLHttpRequest对象
request=new XMLHttpRequest();
if(request.overrideMimeType){
request.overrideMimeType('text/xml');
}
return request;
}
}
var http=createXMLHttp();
//对xmlhttp对象实例化,并且全局
//======================================================
//检测用户的name email 是否存在
function check_user(name,value){
var url="../back/douser.php?act=check&";
url+=("name="+name+"&value="+value);
alert(url);
http.open("GET",url,true);
http.onReadyStateChange=ProcessHttpResponse;
http.send(null);
return;
}
function processhttpresponse(){
if(http.readystate==4){
if(http.status==200){
var xmldocument=http.responsexml;
if(http.responsetext!=""){
document.getElementByName("check_result").style.display="";
document.getElementByName("uname").style.background="#FF0000";
document.getElementByName("check_result").innertext=http.responsetext;
}
}
}else{
alert("找不到服务器!");
}
}
//===================================================
</script>
<title>无标题文档</title>
</head>
<body>
<div class="story">
<p>原先的邮箱地址:<a href="mailto:default.fu@gmail.com">default.fu@gmail.com</a></p>
<form action="../back/douser.php?act=change" method="post" target="_self">
<p>新邮箱地址:
<input name="textfield" type="text" id="textfield" onblur="javascript:check_user(this.name,this.value);" maxlength="30" style="background:#FFFFFF"/>
</p>
<p><input type="submit" name="submit" value="提交" id="submit" />
</p>
</form>
</div>
</body>
</html>
//======================================================
//检测用户的name email 是否存在
function check_user(name,value){
var url="../back/douser.php?act=check&";
url+=("name="+name+"&value="+value);
alert(url);
/*
http.open("GET",url,true);
http.onReadyStateChange=ProcessHttpResponse;
http.send(null);
*/
return;
}
//===================================================
function check_user(name,value){
var url="../back/douser.php?act=check&";
url+=("name="+name+"&value="+value);
alert(url);
http.open("GET",url,true);
http.onReadyStateChange=ProcessHttpResponse;//这里只要求方法名
//或者这样
http.onReadyStateChange=function(){ProcessHttpResponse();}
http.send(null);
return;
}