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

ÓÃAjax·ÂGoogle ½¨ÒéÁбíʵÀý

 AjaxSuggest.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxSuggest.aspx.cs" Inherits="AjaxSuggest" %>
<!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 runat="server">
<title>ÎÞ±êÌâÒ³</title>
<mce:style type="text/css"><!--
body{
font:21px;
}
.Link{
background-color:#FFFFFF;
padding:2px 6px 2px 6px;
}
.LinkOver{
background-color:#3355ff;
padding:2px 6px 2px 6px;
}


--></mce:style><style type="text/css" mce_bogus="1"> body{
font:21px;
}
.Link{
background-color:#FFFFFF;
padding:2px 6px 2px 6px;
}
.LinkOver{
background-color:#3355ff;
padding:2px 6px 2px 6px;
}

</style>
<mce:script type="text/javascript" language="javascript" src="js.js" mce_src="js.js"></mce:script>
</head>
<body>
<form id="form1" runat="server">
<div>
ajax½¨ÒéÁÐ±í£º<br /><br />
<input id="texSearch" name="texSearch" type="text" onkeyup="getSuggest(this.value)" /><input id="Button1" type="submit" value="²éÕÒ" />
<br />
<div id="suggest" style=" display:none; position:absolute;background-color:#FFFFFF;text-align:left;border:1px solid #000000; width: 236px; height: 135px;">

</div>

</div>
</form>
</body>
</html>
js.js
var XMLRequest = false;
function CreatHTTPRequest()
{
try {
XMLRequest = new XMLHttpRequest();
}
catch (trymicrosoft) {
try {
XMLRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
XMLRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
XMLRequest = false;


Ïà¹ØÎĵµ£º

AjaxÌØЧ ¸ù¾ÝÓÊÕþ±àÂë»ñÈ¡µØÇøÐÅÏ¢ Ö®¶þ

Êý¾Ý¿âÉè¼Æ
±¾ÊµÀýʹÓÃÃûΪpostalcodeµÄÊý¾Ý¿â±í£¬°üº¬µÄ²¿·ÖÊý¾ÝÈçͼ1.4Ëùʾ¡£¾ßÌåµÄ´´½¨Êý¾Ý±íÓï¾äÈçÏ£º
 
CREATE TABLE 'postalcode' (
  'id' int(11) NOT NULL auto_increment,
  'area' varchar(255) NOT NULL,
  'city' varchar(255) NOT NULL,
  'code' varchar(6) NOT NULL,
&n ......

½â¾öAJAX(JSP)ÖÐÎÄÂÒÂë»òÌØÊâ·ûºÅ£¨&£©µÄ´«µÝÎÊÌâ

½â¾öAJAX(JSP)ÖÐÎÄÂÒÂë»òÌØÊâ·ûºÅ£¨&£©µÄ´«µÝÎÊÌâ----> ±¾ÈËÔ­´´£¨244796562@qq.com£©
************************js******************************
...
...
var s = encodeURIComponent("ÖÐÎÄ&English&@#$%!");
xmlReq.send("test", "txt=" + s, callback, callerror);//ͨ¹ýXMLHTTPRequest·¢ËÍ×Ö·ûÊý¾ ......

ajaxÔ­Àí

AjaxµÄÔ­Àí¼òµ¥À´ËµÍ¨¹ýXmlHttpRequest¶ÔÏóÀ´Ïò·þÎñÆ÷·¢Òì²½ÇëÇ󣬴ӷþÎñÆ÷»ñµÃÊý¾Ý£¬È»ºóÓÃjavascriptÀ´²Ù×÷DOM¶ø¸üÐÂÒ³Ãæ¡£ÕâÆäÖÐ×î¹Ø¼üµÄÒ»²½¾ÍÊÇ´Ó·þÎñÆ÷»ñµÃÇëÇóÊý¾Ý¡£ÒªÇå³þÕâ¸ö¹ý³ÌºÍÔ­Àí£¬ÎÒÃDZØÐë¶Ô XMLHttpRequestÓÐËùÁ˽⡣
XMLHttpRequestÊÇajaxµÄºËÐÄ»úÖÆ£¬ËüÊÇÔÚIE5ÖÐÊ×ÏÈÒýÈëµÄ£¬ÊÇÒ»ÖÖÖ§³ÖÒì²½ÇëÇóµÄ¼¼Êõ¡ ......

ASP.netÖеÄAJAXѧϰ¼Ç¼

 ½ñÌìÎÒÖ÷ҪѧϰÁËUpdateModeÊôÐÔ¼°Ê¹ÓÃUpdateTriggers£¬°ÑÊéÖÐËù½ÌÊÚµÄÄÚÈÝÓöà¸öÀý×Óʵ¼ùÁËһϣ¬È·ÊµÃ÷°×ÁËÐí¶à¡£
  UpdateMode
      Ê×ÏÈÔÚÉÏһƪҲÌáµ½¹ýÕâÑùÒ»¸öÀíÂÛ£ºÔÚ̸ÂÛUpdatePanel¿Ø¼þµÄË¢ÐÂʱ£¬µ±UpdatePanel¿Ø¼þÖеÄ×ӿؼþ´¥·¢Async-Postback¶¯×÷ʱ£¬Ë¢ÐµÄÇøÓòÊ ......

AJAX¿ò¼Ü DWR ¼òµ¥ÅäÖÃ

¼òµ¥µÄÃèÊöÏ DWR ÅäÖ㨱£ÃÜЭÒ飬Ôڴ˲»¹«¿ªÏîÄ¿Ãû³Æ£¬ÏîÄ¿Ïà¹ØÃû³ÆÈ«²¿ÓÃXXXX´úÌ棩
Ê×ÏÈ ·Ï»°²»ËµÁË ´ó¼Ò¶¼Ó¦¸ÃÀí½âDWRµÄÓô¦ ²»¶®µÄÈ¥°Ù¶È
±ØÒª°ü DWR.JAR ¹Ù·½ÏÂÔصØÖ·http://directwebremoting.org/dwr/download.html
Õâ¸öÏîÄ¿ÊÇÓÉ SSH+dwr+jquery+sitemesh+freemarker
WEB.XML
<!-- dwr -->
<serv ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ