JScript code:
function callback() {
alert(18); //²âÊÔÊÇ·ñµ÷ÓÃÁËcallback»Øµ÷º¯Êý
if (httpRequest.readyState==4) {
if(httpRequest.status==200){
alert(3); //²âÊÔÊÇ·ñ×¼±¸ºÃ·µ»Ø´¦Àí½á¹û
var rs = httpRequest.responseText;
if(rs==0){
......
×î½üѧϰAJAX,²ÎÕÕhttp://dev.yesky.com/msdn/183/2426683.shtml×Ô¼º×öÁËÒ»¸öÁÐ×Ó£¬µ«ÊÇ×ÜÊÇÔÚJS´¦±¨´í_Default䶨Ò壬²»ÖªµÀʲôÔÒò¡£
ǰ̨ҳÃ棺
function comit_onclick()
{
¡¡var name=document.getElementById("tb1").value;
¡¡_Default.SetTb(name,callback);
}
ºǫ́£º
protect ......
֮ǰÓöµ½Ò»¸öÎÊÌâ¡£
ÓÚÊÇ×öÁËÒÔÏÂʵÑ飺
Ò³Ãæ¼ÓÔغó£¬Ìá½»Ò»¸öAjaxÇëÇó(ÔݳÆΪajax1)£¬ÇëÇóµÄÏß³ÌÔÚ·þÎñÆ÷Éϱ»Ë¯Ãß10ÃëÖÓ¡£
µã»÷Ò³ÃæÉÏÒ»¸öbutton£¬´¥·¢ÁíÒ»¸öAjaxÇëÇó(ajax2)¡£
µ±Ã»ÓÐʹÓÃsession£¬ÔÚ·þÎñÆ÷δ´¦ÀíÍêajax1µÄÇëÇóʱ£¬·þÎñÆ÷ÒÀÈ»¿ÉÒÔ´¦Àíajax2µÄÇëÇó¡£
µ«ÊÇ£¬µ±Ê¹ÓÃÁËsession£¬ÔÚ·þÎñÆ÷δ´¦ÀíÍêajax1µÄÇ ......
var xmlHttp = null;
function Getxmlhttp()
{
var url = "update.php";
if (xmlHttp == null)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("ÄúµÄä¯ÀÀÆ÷²»Ö§³ÖAJAX£¡ÇëÉý¼¶ä¯ÀÀÆ÷°æ±¾!");
&n ......
ajaxʹÓÃÖÐÓöµ½¼¸¸öÎÊÌ⣬Çë¸÷λ°ïæ¡£
1¡¢Ê¹Óà alert(xmlhttp.responsetext); µ¯³öµÄÈ´ÊÇÕû¸öÒ³ÃæµÄHTMLÎı¾¡£
2¡¢Ê¹ÓÃxmlhttp·¢³öµÄÇëÇó£¬ÔÚÁíÒ»Ò³ÃæµÄPage_LoadÀͨ¹ýÓï¾äµÃµ½Ò»¸ö±íµÄÖµ£¬ÈçºÎ½«Õâ¸ö±íµÄÖµ·µ»Ø£¿È»ºóͨ¹ýAJAX½«·µ»ØµÄÖµ¸³¸ø±¾Ò³Ò»¸öultrawebgrid?
ÏÈ°Ñhtml´úÂëÇå¿ÕÁË.
......
¼ÙÈçÒ»¸öÒ³ÃæÉÏÓÐN¸ö²Ù×÷£¬¶¼ÒªÓÃAJAX ²»Óÿؼþ£¬×Ô¼ºÐ´JS
ÀýÈç <a href="#" onclick="">aaaa </a>
<a href="#" onclick="">aaaa </a>
<a href="#" onclick="&quo ......