Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

AjaxÖÐÇëÇó±»»º´æµÄÎÊÌâ

½ñÌì¸ãÁËÎÒÈýËĸöСʱµÄÎÊÌ⣬ÖÕÓÚÕÒµ½½â¾ö·½°¸ÁË¡£¹þ¹þ¡£
ÔÚAjax¿ª·¢ÖУ¬»áÓöµ½ä¯ÀÀÆ÷»º´æÄÚÈݵÄÎÊÌ⣬±ÈÈ磬ij¸öÔªËØ×¢²áÁËÊó±êʼþ£¨onmouseover£©£¬Ê¼þ´¥·¢ºó»áͨ¹ýxmlhttprequestµ½·þÎñÆ÷»ñÈ¡ÄÚÈÝ£¬ÔÚ²»Ë¢ÐÂÒ³ÃæµÄÇé¿öÏ£¬ä¯ÀÀÆ÷»á»º´æµÚÒ»´ÎÇëÇóµÄÄÚÈÝ£¬·þÎñ¶Ë¸üкóä¯ÀÀÆ÷ÈÔÈ»ÏÔʾµÚÒ»´ÎµÄÄÚÈÝ¡£
ͨ³££¬ÕâÖÖÇëÇó¶¼ÊÇxmlhttprequest·¢ÆðµÄGETÇëÇ󡣸ù¾Ý HTTP ¹æ·¶£¬GET ÓÃÓÚÐÅÏ¢»ñÈ¡£¬¶øÇÒÓ¦¸ÃÊÇÃݵȵġ£Ò²¾ÍÊÇ˵£¬µ±Ê¹ÓÃÏàͬµÄURLÖØ¸´GETÇëÇó»á·µ»ØÔ¤ÆÚµÄÏàͬ½á¹ûʱ£¬GET·½·¨²ÅÊÇÊÊÓõġ£µ±¶ÔÒ»¸öÇëÇóÓи±×÷ÓõÄʱºò£¨ÀýÈ磬Ìá½»Êý¾Ý×¢²áÐÂÓû§Ê±£©£¬Ó¦¸ÃʹÓÃPOSTÇëÇó¶ø²»ÊÇGET¡£ËùÒÔä¯ÀÀÆ÷»á¶ÔGETÇëÇó×ö»º´æ´¦Àí¡£
½â¾ö°ì·¨£º
Ò». GETÇëÇóURLºó¸½¼Ó×Ö´®£¬È÷þÎñÆ÷ÈÏΪ²»ÊÇÏàͬµÄÇëÇó¡£
Àý “http://www.example.com/index.php?class=aitcle&page=5&_t=” + new Date().getTime()
¶þ. ÔÚajax·¢ËÍÇëÇóǰ¼ÓÉÏ xmlHttpRequest.setRequestHeader(”If-Modified-Since”,”0″)
Èý. ÔÚajax·¢ËÍÇëÇóǰ¼ÓÉÏ xmlHttpRequest.setRequestHeader(”Cache-Control”,”no-cache”);
ËÄ. ·þÎñ¶ËÏìÓ¦ÇëÇóʱ¼Ó header(”Cache-Control: no-cache, must-revalidate”); £¨PHP£©
Îå. ʹÓÃPOST´úÌæGET£¬ä¯ÀÀÆ÷²»»á¶ÔPOST×ö»º´æ
¸½Â¼£º
RFC1945ÖеÄÓ¢ÎÄÔ­ÎÄÈçÏ£º
8.1 GET
The GET method means retrieve whatever information (in the form of an
entity) is identified by the Request-URI. If the Request-URI refers
to a data-producing process, it is the produced data which shall be
returned as the entity in the response and not the source text of the
process, unless that text happens to be the output of the process.
The semantics of the GET method changes to a “conditional GET” if the
request message includes an If-Modified-Since header field. A
conditional GET method requests that the identified resource be
transferred only if it has been modified since the date given by the
If-Modified-Since header, as described in Section 10.9. The
conditional GET method is intended to reduce network usage by
allowing cached entities to be refreshed without requiring multiple
requests or trans


Ïà¹ØÎĵµ£º

ajax¾Ö²¿Ìá½»

ʵÏÖ¹¦ÄÜ£ºµ¥»÷°´Å¥£¬½«´ÓÊý¾Ý¿â»ñÈ¡µÄÊý¾Ý·µ»Ø¸øÎı¾¿ò1(Ë¢ÐÂÎı¾¿ò1)£¬¶øÎı¾¿ò2²»Ë¢ÐÂ
Ò³Ãæ1£ºtest.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ......

AJAXÖÐÎÄÎÊÌâ[ת]

AJAXÖÐÎÄÎÊÌâ·ÖΪÁ½´óÀࣺ
1£©·¢ËÍ·¾¶ÖеIJÎÊýÓÐÖÐÎÄ£¬ÔÚ·þÎñÆ÷¶Î½ÓÊÕ²ÎÊýÖµÊÇÂÒÂë
ÀýÈ磺
var url="a.jsp?name=СÀî"£»
xmlHTTP.open ("post",url,true);
½â¾ö°ì·¨£º
ÀûÓÃjavascriptµÄÌṩµÄescape()»òencodeURI()·½·¨
ÀýÈ磺
¿Í»§¶Ë£º
var url="a.jsp?name=СÀî"£»
url=encode ......

½Ó´¥AjaxµÄµÚÒ»¸öʵÑéHello Word

<html>
<head>
<title>new ajax</title>
<mce:style type="text/css"><!--
body{
margin-top:50px;
}
.MyDiv{
font-size:12px;
border:1px solid #DDD;
background-color:#FFD;
margin:2px;
width:200px;
}

--></mce:style><style type="t ......

¼òµ¥AjaxÓëJSPÏà½áºÏÒ³Ãæ

»·¾³£ºAjax+JSP£¬Tomcat5.05
²Î¿¼£ºhttp://www.w3cschool.cn/index-24.asp.htm
Îļþ£ºtestAjax.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb ......

jQuery ajaxÖÐÎÄAPI¼°½Ì³Ì×ÊÁÏ´óÈ«

jQueryÓÉÃÀ¹úÈËJohn Resig´´½¨£¬ÖÁ½ñÒÑÎüÒýÁËÀ´×ÔÊÀ½ç¸÷µØµÄÖÚ¶àjavascript¸ßÊÖ¼ÓÈëÆäteam£¬°üÀ¨À´×Ե¹úµÄJörn Zaefferer£¬ÂÞÂíÄáÑǵÄStefan PetreµÈµÈ¡£
¡¡¡¡jQueryÊǼÌprototypeÖ®ºóÓÖÒ»¸öÓÅÐãµÄJavascrīpt¿ò¼Ü¡£Æä×ÚÖ¼ÊÇ——WRITE LESS,DO MORE,д¸üÉٵĴúÂë,×ö¸ü¶àµÄÊÂÇé¡£
¡¡¡¡ËüÊÇÇáÁ¿¼¶µÄjs¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ