ajax1.0²»Ö§³ÖResponse.writeÀïÃæµ÷ÓÃjavascript
ÎÊÌ⣺
µ±Óû§µã»÷ɾ³ý°´Å¥Ê±£¬³ÌÐòµ÷ÓÃResponse.write("<script>alert('ÊÇ·ñ¼ÌÐø')</script>")ÊÇÒ³Ãæ»áµ¯³ö´íÎó£º
Sys.WebForms.PageRequestManagerParserErrorException:The
message received from the server count not be parsed.Common causes for
this error are when the response is modified by calls to
response.Write(),response filters,HttpModules,or server trace is
enabled.
Details:Error parsing near '<script language=javascript'.
ÔÒò£º
ÓÉÓÚÒ³ÃæÖмÓÈëÁËUpdatePanel£¬¶øÇÒɾ³ý°´Å¥ÔÚUpdatePanelÀïÃæ¡£
µ±Óû§µã»÷ɾ³ý°´Å¥Ê±£¬ajax1.0²»Ö§³ÖResponse.writeÀïÃæµ÷ÓÃjavascript¡£
½â¾ö°ì·¨£º
ÔÚUpdatePanelµÄÊôÐÔÖÐÌí¼ÓPostBackTrigger£¬ControlIDΪ¸Ãɾ³ý°´Å¥£¬ÈçÏ£º
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="Button1" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
´ËʱÎÒÃÇÔÙµ¥»÷ Button1 ½«³öÏÖÒ³ÃæÉÁ˸£¬ËµÃ÷ʵÏÖÁËÕûÒ³»ØËÍ¡£PostBackTrigger Ö»ÓÐÒ»¸öÊôÐÔ£ºControlID¡£
Ïà¹ØÎĵµ£º
Web¿ª·¢Õß²»»á×¢Òâµ½ÓÉ “AJAX(Asynchronous JavaScript And
XML)”Ëù´øÀ´µÄ¼¤Çé¡£²»·ÑÁ¦Æø¾ÍÄÜ´´½¨ÏñGoogle
SuggestÄÇÑùµÄÖÇÄÜÍøÕ¾»òÕßÏñGmailÄÇÑù»ùÓÚWebµÄÓ¦ÓóÌÐò£¬ÕâÔںܴó³Ì¶ÈÉÏÒª¹é¹¦ÓÚÕâÖÖ¼¼Êõ¡£È»¶ø£¬°éËæ×ÅAJAXÓ¦ÓóÌÐòµÄ·¢Õ¹£¬ÎÒÃÇ·¢
ÏÖÁËËüµÄһЩ²»×ãÖ®´¦£¬ÎÒÃÇ·¢ÏÖËüµÄ°²È«Â©¶´Ò²ÔÚÖð½¥±ä´ó£¬¾ÍÏ ......
ajax¿çÓòºÍJSµÄ¿çÓòͨÐÅ(Cross The Site)µÄ¼¸ÖÖ½â¾ö·½°¸
×î½ü×öµÄÒ»¸öÏîÄ¿ÖÐÐèÒªajax¿çÓòÈ¡µÃÊý¾Ý,Èç¹ûÊÇÔÚ±¾ÓòÖÐȷʵûÓÐÎÊÌ⣬µ«ÊǷŵ½¶þ¼¶ÓòºÍÆäËûÓòÏÂä¯ÀÀÆ÷Ö±½Ó¾Íµ¯³öÌáʾ¿ò:“¸ÃÒ³ÕýÔÚ
1.ʲôÒýÆðÁËajax¿çÓò²»ÄܵÄÎÊÌâ
ajax±¾Éíʵ¼ÊÉÏÊÇͨ¹ýXMLHttpRequest¶ÔÏóÀ´½øÐÐÊý¾ÝµÄ½»»¥£¬¶øä¯ÀÀÆ÷ ......
http://www.longboo.com/
·ÖÒ³
http://www.longboo.com/Samples/linb/widgets/TreeGrid.Paging/index.html
Êý¾Ý¿â²éѯ¹¤¾ß
http://www.longboo.com/Samples/comb/OrderManagement/index.html
email¹¤¾ß
http://www.longboo.com/Samples/comb/OutLook/index.html
Íøµê
http://www.longboo.com/Samples/linb/Template ......
AJAX±íµ¥Ìá½»·½·¨£¨JSON£©
1./*****JAVA**************************************************************/
JAVAÀàÖУº
/*****JAVA**************************************************************/
2./*****struts.xml**************************************************************/
struts.xmlÎļþÖУº
......
ÔÚajaxû³öÀ´Ö®Ç°£¬Ò»Ö±ÊÇÓÃiframeʵÏÖµÄÎÞË¢ÐÂÇëÇó¡£
Ö÷ÒªµÄÔÀíÊÇ£º
ʹÓÃjs´´½¨Ò»¸öÒþ²ØµÄiframe
°ÑÒªÌá½»µÄ±íµ¥µÄtargetÊôÐÔÖ¸Ïò1ÖÐÉú³ÉµÄiframe
ÔÚÇëÇóµÄÒ³ÃæÖлص÷¸¸Ò³ÃæµÄ·½·¨
ÕâÑù¾ÍʵÏÖÁËÒ»¸ö¼òµ¥µÄ“Òì²½Ìá½»”
¿´ÆðÀ´ºÍajaxÒ»ÑùµÄЧ¹û£¬ÄÇΪʲô»¹ÒªÓÐajax£¬ÎÒÃÇÀ´±È½ÏÏ£º£¨ÒÔϰÑajax¼¼Êõ³ÆÎªX ......