ajaxѧϰ¼
ÓйØajaxµÄÆäʵ¾ÍÊÇ1¸öÀàµÄʹÓÃ:XMLHttpRequest.
Ê×ÏÈÒªÉùÃ÷Õâ¸öÀàµÄ¶ÔÏ󣬼øÓÚ¸÷¸öä¯ÀÀÆ÷°ÑÕâ¸öÀàǶÈëµÄ·½Ê½²»Í¬£¬ÉùÃ÷µÄ·½Ê½Ò²²»Í¬£º
var xmlHttpReq = null;
if (window.XMLHttpRequest) //Mozilla ä¯ÀÀÆ÷
{
¡¡¡¡¡¡ xmlHttpReq = new XMLHttpRequest();
¡¡¡¡}
¡¡ else if (window.ActiveXObject) // IEä¯ÀÀÆ÷
{
try
{
xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("ÄúµÄä¯ÀÀÆ÷²»Ö§³ÖAJAX£¡") ;
}
} ¡¡¡¡
¡¡ }
else
{
alert("ÄúµÄä¯ÀÀÆ÷²»Ö§³ÖAJAX£¡") ;
}
È»ºóÊÇopen£¬send£¬getresponse
xmlHttpReq.open("POST","http://localhost///6gold/home_validate.php",true);
xmlHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttpReq.onreadystatechange = function()
{
if (xmlHttpReq.readyState == 4)
{
if (xmlHttpReq.status == 200)
{
document.getElementById('span_' + key).innerHTML = xmlHttpReq.responseText;
}
}
}
xmlHttpReq.send("personid=<?php echo($_SESSION['uid']); ?>" + "&key=" + key + "&value=" + value);
ÕâÀïÓõÄÊÇPOST·½·¨£¬ÈôÓÃGET£¬×îºóÒ»¾äsend¿ÉÒÔ¸ÄΪ
xmlHttp.send(null);
»òÕß
xmlHttp.send("");
×¢Ò⣺
xmlHttpReq.onreadystatechangeʼþ ҪдÔÚ xmlHttpReq.send()ʼþ֮ǰ¡£ÒòΪÈç¹ûÏÈsend£¬ÔÙ²¶×½onreadystatechangeµÄ»°£¬send¿ìµÄ»°£¬readystateÒѾ±äΪ4£¨³É¹¦·µ»Ø£©ºó²Å¿ªÊ¼²¶×½readystatechangeʼþ£¬»á²¶×½²»µ½¡£
xmlHttpReq.responseTextµÄÄÚÈÝËƺõÊÇ·þÎñ¶ËÒ³ÃæµÄ<body></body>¼äµÄÄÚÈÝ£¬²»ÊǺÜÈ·¶¨¡£
get·½Ê½´«ÖÐÎÄËƺõ»á³ö±¨´í£¬¸ÄÓÃpost´«ÖÐÎÄ£¬¿Í»§¶Ë->·þÎñ¶Ë,ûÓÐÎÊÌ⣻·þÎñ¶Ë->Êý¾Ý¿â(sql server2005)->¿Í»§¶Ë£¬¾Í»á³öÏÖÂÒÂ룬²»ÖªµÀÄÄÀïÓÐÎÊÌ⣬ÎÒÊÇÔÚ·þÎñ¶Ëת»»ÁËϱàÂë¸ã¶¨µÄ£ºecho mb_convert_encoding($msg,"utf-8","gb2312");
Ïà¹ØÎĵµ£º
µ½Èí¼þ¹«Ë¾Ñ§IT¼¼Êõhttp://www.tsp2c.cn/
Ajax Ó¦¸Ã²»ÊÇÒ»Ïî¼¼Êõ£¬ÊÇÒ»ÖÖ˼Ïë¶øÒÑ£¬¸ú ASP.NET ÒÔ¼°ÆäËü Web ¿ª·¢ÓïÑÔûÓÐʲô̫´ó¹Øϵ£¬ÕâÀïÖ»ÊÇ̸̸ ASP.NET ÖÐĿǰʹÓÃµÄ Ajax ¼¼ÊõÒÔ¼°ÆäËüһЩʵÏÖ Ajax µÄÓÅÐã¿ò¼Ü¡£
¡¡¡¡Ajax ÒѾºÜÁ÷ÐÐÒ»Õó×ÓÁË£¬ÏÖÔÚ̸ Ajax ¾õµÃÓеãÀÏÍÁ¡£Ä¿Ç°ËùνµÄ Web2.0 ÍøÕ¾£¬»ù±¾ÉÏûÓв» ......
FlexÓëAjax½»»¥
ÈýÏ¿´óѧÍÁľˮµçѧԺФÔóÔÆ
FlexÓëAjax¶¼ÊÇ¿ª·¢AIR·Ç³£ºÃµÄ¼¼Êõ£¬ËüÃǸ÷ÓÐÓÅȱµã¡£Flex¸ü¼òµ¥£¬Ð§¹û¸ü¼Ó¿á£¡µ«ÊÇÔÚ¹¦ÄÜ¿ª·¢µÈ·½Ãæ²»¼°Ajax³ÉÊì¡£×îÀíÏëµÄ¾ÍÊÇÈ«²¿ÓÃFlexÀ´¿ª·¢ÊµÏÖ£¬µ«ÕâÖ»ÊÇÒ»ÖÖÀíÏë״̬£¬ºÜ¶àʱºòÎÒÃÇ»¹ÊÇÒªÓõ½Ajax¡£ÎÒÃǾ³£ÐèÒª½«Ç¶Èëµ½ Ajax Ó¦ÓóÌÐòÖеĻùÓÚ Flash µÄ×ÊÔ´¼¯³ÉÔÚÒ» ......
¿´¿´ Ajax ºÍ DOM ½Å±¾±à³Ì¾¿¾¹Óжà¼òµ¥
ÎĵµÑ¡Ïî
½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ
¼¶±ð£º Öм¶
Jesse Skinner, Web ¿ª·¢ÈËÔ±, Freelance
2007 Äê 5 ÔÂ 16 ÈÕ
jQuery ÊÇÒ»¸öJavaScript ¿â£¬ËüÓÐÖúÓÚ¼ò»¯ JavaScript™ ÒÔ¼° Asynchronous JavaScript + XML (Ajax) ±à³Ì¡£ÓëÀàËÆµÄ JavaScript ¿â²»Í¬£¬jQuery ......
1. http://hi.baidu.com/lshun/blog/item/2378b4c36fdef455b219a85b.html
CODE:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<pets>
<è />
<¹· />
< ......
PHP 5.2 ¼°ÒÔÉÏ°æ±¾ÌṩÁË json_encode ºÍ json_decode º¯Êý£¬Ï൱ºÃÓá£
¶ø֮ǰµÄ°æ±¾ÔòÐèÒªÏÂÔØÍøÓÑÃÇ×ÔÐпª·¢µÄ¿â£¨ÓÐÐËȤµÄ¿ÉÒÔ¿´Ï http://code.itlearner.com/php/JSON-class.html £©
¿ÉÒԲο¼ÈçÏÂÕâ¸ö·½·¨À´ÔڵͰ汾ÉÏÀ©³äÕâÁ½¸öº¯Êý£º
if (!function_exists('json_encode') && !function_exists('j ......