1.在网上常常用到需要大量查询数据,都是,经常采用异步处理的Ajax具体的实现
javascript原始版
jQuery版
$(function(){
$("a").click(function(){
/*$.ajax({
type:"post",
url:"data.jsp",
dataType:"html",
success:function(data){
alert("成功之后的数据:"+data);
},
error:function(){
alert("失败鸟!");
}
});
jQuery版 传值
$.post("data.jsp",{"txtname":"值","txtpwd":"值"},function(data){
$("#divobj").html(data);//字符串
});
不传值
$.post("data.jsp",function(data){
$("#divobj").html(data);//字符串
});