码迷,mamicode.com
首页 > 其他好文 > 详细

axja

时间:2017-10-16 21:46:42      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:orm   ati   amp   原生态   javascrip   rom   分享   head   ajax技术   

1.Ajax技术合成 异步的JavaScript and xml css 资源

2.异步请求和局部刷新。
同步请求:等待第一个请求响应数据回发回来后,再发送第二次请求。
$.ajax(是否异步)

3.Ajax怎么运作? 一把枪 谁?js驱动这把枪
原生态Ajax核心对象:
判定当前的浏览器引擎有没有哪个对象? 能力检查 (情况1:IE 和非IE chrome和FireFox)
1.构建核心对象 XmlHttpRequest xhr;


2.设置他的属性和方法
xhr.open("post","/FirstServlet",true);
xhr.onreadystatechange=funtion(){
if(xhr.readyState==4&&xhr.status==200){
}

};

你要想发送Post请求,必须得有Content-Type
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhr.send(get:null/post:data);

4.使用jQuery实现Ajax
function newAjax() {
$.ajax({
url:"/FirstServlet",
type:"POST",
data:{"uname":$("[name=uname]").val()},
async:true,
success:function (data) {
$("#msg").html(data);
}
});
}

 

 

 

传统Web与Ajax的区别:

技术分享

 

axja

标签:orm   ati   amp   原生态   javascrip   rom   分享   head   ajax技术   

原文地址:http://www.cnblogs.com/hsa521/p/7678464.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!