本人没有学过ajax,请问什么ajax请求?主要是下面的代码不太懂?请问有什么作用呢?我应该补充哪方面的知识?谢谢$.ajax({
url: "/ logout /action/post/",
type:"post",
dataType:"html",
data: pageParam,
success:function(msg){
alert(‘请求’);
}
});
url: "/ logout /action/post/",
type:"post",
dataType:"html",
data: pageParam,
success:function(msg){
alert(‘请求’);
}
});
function loadXMLDoc() {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
alert('请求');
}
}
xmlhttp.open("POST", "/ logout /action/post/", true);
xmlhttp.send();
}
url: "/ logout /action/post/", // 提交给服务器的/ logout /action/post/程序处理
type:"post", // 提交方法POST
dataType:"html", // 数据类型是HTML
data: pageParam, // 提交时包含的参数是pageParam
success:function(msg){
alert('请求'); // 服务器成功返回后,在浏览器端的处理
}
});
$.ajax({
url: "/ logout /action/post/",//请求路径(地址)
type:"post",//请求方式(get和post)
dataType:"html",//请求数据类型(xml、html、text好像是这几种)
data: pageParam,//请求过去的时候传过去的参数
success:function(msg){//如果请求成功,请在这个函数(回调函数)中执行剩余操作,msg是返回的数据
alert(‘请求’);
}
});