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

AjaxÖÐsend·½·¨²ÎÊýµÄʹÓÃ


AjaxÖÐsend·½·¨²ÎÊýµÄʹÓÃ
Ò»°ãÇé¿öÏ£¬Ê¹ÓÃAjaxÌá½»µÄ²ÎÊý¶àÊÇЩ¼òµ¥µÄ×Ö·û´®£¬¿ÉÒÔÖ±½ÓʹÓÃGET·½·¨½«ÒªÌá½»µÄ²ÎÊýдµ½open·½·¨µÄurl²ÎÊýÖУ¬´Ëʱsend·½·¨µÄ²ÎÊýΪnull¡£
ÀýÈç £º
      var url = "login.jsp?user=XXX&pwd=XXX";
      xmlHttpRequest.open("GET",url,true);
      xmlHttpRequset.send(null);
´ËÍ⣬Ҳ¿ÉÒÔʹÓÃsend·½·¨´«µÝ²ÎÊý¡£Ê¹ÓÃsend·½·¨´«µÝ²ÎÊýʹÓõÄÊÇPOST·½·¨£¬ÐèÒªÉ趨Content-TypeÍ·ÐÅÏ¢£¬Ä£ÄâHTTP POST·½·¨·¢ËÍÒ»¸ö±íµ¥£¬ÕâÑù·þÎñÆ÷²Å»áÖªµÀÈçºÎ´¦ÀíÉÏ´«µÄÄÚÈÝ¡£²ÎÊýµÄÌá½»¸ñʽºÍGET·½·¨ÖÐurlµÄд·¨Ò»Ñù¡£ÉèÖÃÍ·ÐÅϢǰ±ØÐëÏȵ÷ÓÃopen·½·¨¡£
ÀýÈ磺
     xmlHttpRequest.open("POST","login.jsp",true);
     xmlHttpRequest.setRequestHeder("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
     xmlHttpRequest.send("user="+username+"&pwd="+password);
 ÐèҪעÒâµÄÊǸù¾ÝÌá½»·½Ê½µÄ²»Í¬£¬Á½ÖÖÌá½»·½Ê½·Ö±ðµ÷Óúǫ́µÄdoGet·½·¨ºÍdoPost·½·¨¡£


Ïà¹ØÎĵµ£º

ajax¼ò½é

1.´´½¨XMLHttpRequest¶ÔÏó£º
function newXMLHttpRequest() {
var requestObj;
if (window.XMLHttpRequest) {
// Non IE
requestObj = new ActiveObj('XMLHttpRequest');
} else {
//IE
requestObj = new ActiveObj('Microsoft.XMLHTTP');
}
return request ......

[JAVASCRIPT] IFRAME VS AJAX Òì²½Ìá½»

ÔÚajaxû³öÀ´Ö®Ç°£¬Ò»Ö±ÊÇÓÃiframeʵÏÖµÄÎÞË¢ÐÂÇëÇó¡£
Ö÷ÒªµÄÔ­ÀíÊÇ£º
ʹÓÃjs´´½¨Ò»¸öÒþ²ØµÄiframe
°ÑÒªÌá½»µÄ±íµ¥µÄtargetÊôÐÔÖ¸Ïò1ÖÐÉú³ÉµÄiframe
ÔÚÇëÇóµÄÒ³ÃæÖлص÷¸¸Ò³ÃæµÄ·½·¨
ÕâÑù¾ÍʵÏÖÁËÒ»¸ö¼òµ¥µÄ“Òì²½Ìá½»”
¿´ÆðÀ´ºÍajaxÒ»ÑùµÄЧ¹û£¬ÄÇΪʲô»¹ÒªÓÐajax£¬ÎÒÃÇÀ´±È½ÏÏ£º£¨ÒÔÏ°Ñajax¼¼Êõ³ÆΪX ......

Ajax¼¶Áª²Ù×÷

      WebÏîÄ¿ÖÐ×ÜÊÇ»áÓõ½Òì²½²Ù×÷£¬ÏÖÔÚµÄÒì²½²Ù×÷¿ÉÒÔÓø÷ÖÖ¸÷ÑùµÄ¿Ø¼þÀ´ÊµÏÖ£¬µ«ÊµÏÖÔ­Àí»¹ÊÇÒ»ÑùµÄ£¬±¾È˸üϲ»¶Ê¹ÓÃ×îԭʼµÄAjax²Ù×÷ȥʵÏÖÒì²½´¦Àí£¬±¾ÎĽöÏ׸øÄÇЩϲ»¶ÊµÏÖAjaxºÍÏîÄ¿ÖÐÒªÓõ½AjaxµÄÅóÓÑ¡£
      AjaxʵÏÖÔ­Àí¾ÍÊÇ¿Í»§¶Ëͨ¹ýjavascript²Ù×÷µ÷Ó÷ ......

1.ʲôÊÇAjax?

AjaxµÄÈ«³ÆÊÇ£ºAsynchronousJavaScript+XML
2.AjaxµÄ¶¨Ò壺
Ajax²»ÊÇÒ»¸ö¼¼Êõ£¬Ëüʵ¼ÊÉÏÊǼ¸ÖÖ¼¼Êõ£¬Ã¿ÖÖ¼¼Êõ¶¼ÓÐÆä¶ÀÌØÕâ´¦£¬ºÏÔÚÒ»Æð¾Í³ÉÁËÒ»¸ö¹¦ÄÜÇ¿´óµÄм¼Êõ¡£
3.Ajax°üÀ¨£º
XHTMLºÍCSS
ʹÓÃÎĵµ¶ÔÏóÄ£ÐÍ(DocumentObjectModel)×÷¶¯Ì¬ÏÔʾºÍ½»»¥
ʹÓÃXMLºÍXSLT×öÊý¾Ý½»»¥ºÍ²Ù×÷
ʹÓÃXMLHttpRequest½øÐÐÒ ......

Ïê½âAJAXºËÐÄÖеÄXMLHttpRequest¶ÔÏó

XMLHttpRequest ¶ÔÏóÊÇAJAX¹¦ÄܵĺËÐÄ£¬Òª¿ª·¢AJAX³ÌÐò±ØÐë´ÓÁ˽âXMLHttpRequest ¶ÔÏó¿ªÊ¼¡£
¡¡¡¡Á˽âXMLHttpRequest ¶ÔÏó¾ÍÏÈ´Ó´´½¨XMLHttpRequest ¶ÔÏó¿ªÊ¼£¬ÔÚ²»Í¬µÄä¯ÀÀÆ÷Öд´½¨XMLHttpRequest ¶ÔÏóʹÓò»Í¬µÄ·½·¨£º
¡¡¡¡ÏÈ¿´¿´IE´´½¨XMLHttpRequest ¶ÔÏóµÄ·½·¨(·½·¨1)£º
¡¡¡¡var xmlhttp = new ActiveXObject(" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ