9.25 Ajax 基本上搞定,今天的收获
来源:互联网 发布:python notebook 编辑:程序博客网 时间:2024/06/11 23:53
除去过去所学会的,今天又有了很多的收获,比起以前,这次写ajax容易多了,也很轻松~!
var xmlHttpRequest;
function creatXmlHttp(){
if(window.ActiveXObject)
{
xmlHttpRequest=new ActiveXObject("Microsoft.XMLHTTP");
}else{
xmlHttpRequest=new XMLHttpRequest();
}
}
-----------------------
function checkuser(){
creatXmlHttp();
var name=document.all("user").value;
xmlHttpRequest.onreadystatechange=function(){
if (xmlHttpRequest.readyState==4){
if (xmlHttpRequest.status==200){
result=xmlHttpRequest.responseText;
if (result=="true"){
document.getElementById("right").style.display="block";
document.getElementById("wrong").style.display="none";
}else{
document.getElementById("right").style.display="none";
document.getElementById("wrong").style.display="block";
}
}else{
window.status="验证码检验失败,请联系管理员!";
}
}else{
window.status="正在进行验证码检验...";
}
}
xmlHttpRequest.open("post","/ajaxjson/ajax.do?name="+name,true);//true 异步 false 同步 xmlHttpRequest.send(); 后面直接写 result=xmlHttpRequest.responseText; 以前没有发现什么错误。可是今天调试了老半天,都说我网页错误,一查总是这个 result=xmlHttpRequest.responseText 错误~! 好无奈了~!
xmlHttpRequest.send();------------------ 早在一起,不喜欢按规范写,有时候不用这个xmlHttpRequest.onreadystatechange,喜欢直接在
}
- 9.25 Ajax 基本上搞定,今天的收获
- 今天的收获
- 今天的收获
- 今天的一些收获
- 今天的收获-MindManager
- 今天收获的知识。。。。。。
- 今天的编程收获
- 今天的收获哈
- 今天一天的收获
- 今天的小收获!!
- 今天的收获....
- 今天的一些收获
- 今天的收获
- 今天的收获
- 今天的收获
- 今天的收获
- 今天的收获
- 今天的收获
- mysql导入sql文件:Mysql导入导出.sql文件
- __FILE__,__LINE__等在哪儿定义的?
- 使用正则表达式来防止SQL注入攻击
- SAP T-code for searching SAP t-code or SAP menu
- u-boot在s3c2410开发板上移植(NAND Flash Boot)过程
- 9.25 Ajax 基本上搞定,今天的收获
- Python中的代码重用——Modules
- ASDFF
- VC的MFC做的一个画图板程序
- asp.net操作配置文件
- U-BOOT下使用bootm引导内核方法
- 开发辅助工具:SQL文格式化工具SQLinFormpro_Desktop
- Very Busy Recently
- 关于Java中自定义包的创建