- jQuery加载
$(document).ready(function(){ - $("button").click(function(){
- $("#div1").load("/example/jquery/aaaa.txt",function(responseTxt,statusTxt,xhr){
- if(statusTxt=="success")
- alert("外部内容加载成功!");
- if(statusTxt=="error")
- alert("Error: "+xhr.status+": "+xhr.statusText);
- });
- });
- });
- get & post method
- get
$document.ready(function(){
$("#btn").click(function(){
$.get("url",function(data, status){
alert("data:"+data+"\nstatus:"+status);
});
});
});
- post
$("#btn").click(function(){
$.post("url",
{
username:"malin" ,
password:"malin258"
},
function(data, status){
alert("data:"+data+"\nstatus:"+status);
}
)
});
- get
- ASP解析
<%
dim username,passwd
username=Request.Form("username")
passwd=Request.Form("password")
Response.Write("Dear " & username & ". ")
Response.Write("Your passwd is " & passwd & "?")
%>
jQuery日记(5)--jQuery的Ajax
最新推荐文章于 2024-01-01 19:29:48 发布