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

Spring MVC+Ajax´´½¨ÊµÀý


Java´úÂë
@Override  
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object cmd,   
        BindException ex) {   
    String userId=request.getParamater("userId");   
                 Map userInfoMap=userDao.getUserBaseInfo(userId);   
                 JSONObject object = new JSONObject();   
                 object.put("userInfoMap",userInfoMap);   
    response.setContentType("text/Xml;charset=gbk");   
    PrintWriter out = null;   
    try {   
        out = response.getWriter();   
             out.println(object.toString());   
                
    }   
    catch (IOException ex1) {   
        ex1.printStackTrace();   
    }finally{   
                           out.close();   
                  }   
    return nu


Ïà¹ØÎĵµ£º

¹ØÓÚAjaxµÄÒì²½»úÖÆ


Ajax(Asynchronous JavaScript and XML)ÊÇÒ»¸ö½áºÏÁËJava¼¼Êõ¡¢XML¡¢ÒÔ¼°JavaScriptµÄ±à³Ì¼¼Êõ£¬¿ÉÒÔÈÃÄã¹¹½¨»ùÓÚJava¼¼ÊõµÄWebÓ¦Ó㬲¢´òÆÆÁËʹÓÃÒ³ÃæÖØÔصĹßÀý¡£
Ajax£¬Òì²½JavaScriptÓëXML£¬ÊÇʹÓÿͻ§¶Ë½Å±¾ÓëWeb·þÎñÆ÷½»»»Êý¾ÝµÄWebÓ¦Óÿª·¢·½·¨¡£ÕâÑù£¬WebÒ³Ãæ²»Óôò¶Ï½»»¥Á÷³Ì½øÐÐÖØмӲ㬾ͿÉÒÔ¶¯Ì¬µØ¸üС£Ê ......

AjaxµÄ ModalPopupExtender¿Ø¼þ

¸Ã¿Ø¼þ¿ÉÒÔʵÏÖÔÚÒ³ÃæÖе¯³öÒ»¸ö´°¿Ú£¬Õâ¸ö´°¿Ú²»ÊÇÒ»¸öеÄä¯ÀÀÆ÷´°¿Ú£¬¶øÊÇÏâǶÔÚÒ³ÃæÖеÄÒ»¸ö²ã¡£
1 ´´½¨Ò»¸ölinkbutton£¬ÓÃÓÚµã»÷´ò¿ª´°¿Ú¡£
2 ÍÏÈëÒ»¸öpanel£¬Õâ¸ö¾ÍÊÇÎÒÃÇÒªµ¯³öµÄ´°¿Ú¡£ËüÒ²¿ÉÒÔÊÇÁ½¸öǶÌ×µÄpanel¡£Àý³ÌÉÏÊÇÕâÑù×öµÄ£¬»¹ÊÇûÓÐÃ÷°×ΪʲôÕâô×ö¡£
3 ÍÏÈëÒ»¸öModalPopupExtender¿Ø¼þ£¬ÔڸÿؼþµÄta ......

[ËÄÌìѧ»áajax]ѧϰajax½Ì³ÌµÚ¶þÌì

¶àÊý Web Ó¦ÓóÌÐò¶¼Ê¹ÓÃÇëÇó/ÏìӦģÐÍ´Ó·þÎñÆ÷ÉÏ»ñµÃÍêÕûµÄ HTML Ò³Ãæ¡£³£³£Êǵã»÷Ò»¸ö°´Å¥£¬µÈ´ý·þÎñÆ÷ÏìÓ¦£¬ÔÙµã»÷ÁíÒ»¸ö°´Å¥£¬È»ºóÔٵȴý£¬ÕâÑùÒ»¸ö·´¸´µÄ¹ý³Ì¡£ÓÐÁË Ajax ºÍ XMLHttpRequest ¶ÔÏ󣬾ͿÉÒÔʹÓò»±ØÈÃÓû§µÈ´ý·þÎñÆ÷ÏìÓ¦µÄÇëÇó/ÏìӦģÐÍÁË¡£±¾ÎÄÖУ¬Brett McLaughlin ½éÉÜÁËÈçºÎ´´½¨Äܹ»ÊÊÓ¦²»Í¬ä¯ÀÀÆ÷µÄ ......

AjaxÖÐͬ²½ÓëÒì²½Çø±ðµÄÖ±¹ÛÐÔ˵Ã÷

ajax.open·½·¨ÖУ¬µÚ3¸ö²ÎÊýÊÇÉèͬ²½»òÕßÒì²½¡£prototypeµÈjsÀà¿âÒ»°ã¶¼Ä¬ÈÏΪÒì²½£¬¼´ÉèΪtrue¡£
ÏÈ˵ÏÂͬ²½µÄ
Çé¿öÏ£¬js»áµÈ´ýÇëÇ󷵻أ¬»ñÈ¡status¡£²»ÐèÒªonreadystatechangeʼþ´¦Àíº¯Êý¡£
¶øÒì²½ÔòÐèÒª
onreadystatechangeʼþ´¦Àí£¬ÇÒֵΪ4ÔÙÕýÈ·´¦ÀíÏÂÃæµÄÄÚÈÝ
......

ʹÓÃJavascript,CSSºÍAjax´´½¨ASP.NET×Ô¶¨Òå¿Ø¼þ

ÔÚVisual StudioÖУ¬ËùÓеÄASP.NET 2.0¿Ø¼þ¶¼ÊÇ×Ô¶¨Òå¿Ø¼þ£¬´´½¨×Ô¼ºµÄ×Ô¶¨Òå¿Ø¼þÒ»°ãÐèÒªÍê³ÉÒÔÏÂÈý²½¡£
(1)ÔÚÕ¾µãAPP_CodeÏ´´½¨Ò»¸öÐÂÀࣻ
(2)ÐÞ¸ÄÕâ¸öÀ࣬ÈÃËü³ÉΪWebControlÀà(°üº¬ÔÚSystem.Web.UI.WebControlsÃüÃû¿Õ¼ä)µÄÅÉÉúÀࣻ
(3)ÖØд»ùÀà(¼´WebControlÀà)µÄRenderContents()·½·¨¡£
ÏÂÃæÊÇÒ»¸ö×î¼òµ¥µÄASP.NE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ