<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<style>
* {margin:0; padding:0;}
body {font-size:12px;}
#loading {
width:80px;
height:20px;
Background: #bbb;
Color: #000;
Display:none;
}
#resText11
{
Border::solid 1px red;
width:100px; font-size:14px;
}
img{border:0;height:100px;width:100px;}
. comment {margin-top:10px; padding:10px; border:1px solid #ccc; background: #DDD;}
. Comment h6 {font-weight:700; font-size:14px;}
. para {margin-top:5px; Text-indent:2em;background: #DDD;}
</style>
<!--introducing jquery--
<script src= ". /scripts/jquery-1.3.1.js "type=" Text/javascript "></script>
<script>
$ (function ()
{
Demo1:
$ (' #send1 '). Click (Function ()
{
$.getjson ("Http://api.flickr.com/services/feeds/photos_public.gne?tags=car&tagmode=any&format=json &jsoncallback=? ",
function (data)
{
$ ("#resText1"). empty ();
$.each (Data.items, function (I,item)
{
$ ("if (i = = 3)
{
return false;
}
});
}
);
});
Demo2:
$ ("#send2"). Click (Function ()
{
$.get ("get1.asp",
{
Username: $ ("#username"). Val (),
Content: $ ("#content"). Val ()
}, function (data, textstatus)
{
$ ("#resText2"). HTML (data); Add the returned data to the page
}
);
})
Share these 2 global AJAX events
$ ("#loading"). Ajaxstart (function ()
{
$ (this). Show ();
$ ("#resText11"). Hide ();
$ ("#resText11"). HTML ("");
});
$ ("#loading"). Ajaxstop (function ()
{
$ (this). Hide ();
$ ("#resText11"). Show ();
$ ("#resText11"). HTML ("Picture loaded successfully");
});
})
</script>
<body>
<br/>
<div id= "Loading" > Loading in .......</div>
<br/>
Demo1:
<br/>
<input type= "button" id= "Send1" value= "Load"/>
<div id= "ResText1" ></div>
<div id= "resText11" ></div>
<br/>
Demo2:
<br/>
<form id= "Form1" >
<p> Reviews:</p>
<p> Name: <input type= "text" name= "username" id= "username"/></p>
<p> content: <textarea name= "Content" id= "content" ></textarea></p>
<p><input type= "button" id= "Send2" value= "Commit"/></p>
</form>
<div class= ' comment ' > reviews:</div>
<div id= "ResText2" >
</div>
</body>
Get1.asp
<%@ codepage=65001%>
<%
Dim username,content
Username=request. QueryString ("username")
Content=request. QueryString ("content")
Response. Write ("<div class= ' comment ' >
%>
Jquery+ajax data Loading .....