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

Ajax»ù´¡½Ì³Ì

 Ajax ÓÉ HTML¡¢JavaScript™ ¼¼Êõ¡¢DHTML ºÍ DOM ×é³É£¬ÕâÒ»½Ü³öµÄ·½·¨¿ÉÒÔ½«±¿×¾µÄ Web ½çÃæ×ª»¯³É½»»¥Ð﵀ Ajax Ó¦ÓóÌÐò¡£¶ÔÓÚAjax£¬×îºËÐĵÄÒ»¸ö¶ÔÏóÊÇXMLHttpRequest£¬ËùÓеÄAjax²Ù×÷¶¼Àë²»¿ª¶ÔÕâ¸ö¶ÔÏóµÄ²Ù×÷¡£
Ê×ÏÈÎÒÃÇÀ´Á˽âÔõôÔÚjavascriptÖд´½¨Õâ¸ö¶ÔÏó£º
var xmlHttp = new XMLHttpRequest();
ÕâÐмòµ¥µÄ´úÂëÔÚ Mozilla¡¢Firefox¡¢Safari¡¢Opera ÒÔ¼°»ù±¾ÉÏËùÓÐÒÔÈκÎÐÎʽ»ò·½Ê½Ö§³Ö Ajax µÄ·Ç Microsoft ä¯ÀÀÆ÷ÖУ¬´´½¨ÁË XMLHttpRequest ¶ÔÏó¡£µ«ÊǶÔÓÚÊг¡Õ¼ÓÐÂÊ´ïµ½70%µÄIEÀ´Ëµ£¬ÕâÖÖ·½·¨ÊDz»Ðе쬶ø²»Í¬µÄIE°æ±¾»¹Óв»Í¬µÄ´´½¨·½·¨£¬ËùÒÔÎÒÃÇÐèÒªÔÚIEÏÂÃæÊ¹ÓÃÏÂÃæÁ½ÖÖ´´½¨¶ÔÏóµÄ°ì·¨£º
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");//Õë¶Ô½ÏеÄä¯ÀÀÆ÷
} catch (err) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");//Õë¶Ô½ÏÀϵÄä¯ÀÀÆ÷
} catch (err2) {
xmlHttp = false;
}
}
¼´Ê¹ÕâÑù£¬ÎÒÃÇÒ²ÎÞ·¨Ô¤ÁÏÓÐЩä¯ÀÀÆ÷¿ÉÄÜÎÞ·¨´´½¨Õâ¸ö¶ÔÏó£¬ËùÒÔÔÚ´´½¨²»³É¹¦µÄÇé¿öÏ£¬ÎÒÃÇ»¹Òª¼ÓÉÏÒ»¾ä£º
if (!xmlHttp){
alert("ÎÞ·¨´´½¨ XMLHttpRequest ¶ÔÏó£¡");
}
½áºÏÆðÀ´¾ÍÊÇ£º
var xmlHttp = false;
try {
xmlHttp = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
xmlHttp = false;
}
}
}
if (!xmlHttp){
alert("ÎÞ·¨´´½¨ XMLHttpRequest ¶ÔÏó£¡");
}
È»ºó£¬ÈÃÎÒÃǽ¨Á¢Ò»¸öº¯ÊýgetInfo()£¬´ò¿ªÒì²½ÇëÇó£º
function getInfo() {
var num = document.getElementById("num").value;//»ñµÃ±íµ¥µÄÊý¾Ý
var url = "/ajax/1.php?n=" + escape(num);
xmlHttp.open("GET", url, true);//ÕâÀïµÄtrue´ú±íÊÇÒì²½ÇëÇó
}
Ò»µ©Óàopen() ÅäÖúÃÖ®ºó£¬¾Í¿ÉÒÔ·¢ËÍÇëÇóÁË¡£ËäÈ»¿ÉÒÔʹÓàsend() ·¢ËÍÊý¾Ý£¬µ«Ò²ÄÜͨ¹ý URL ±¾Éí·¢ËÍÊý¾Ý¡£ÊÂʵÉÏ£¬Ôڴ󲿷ÖGET&nb


Ïà¹ØÎĵµ£º

AJAX¿ò¼Ü

HTML source:
<p>
Name:
<input type="text" id="demoName"/>
<input value="Send" type="button" onclick="update()"/>
<br/>
Reply: <span id="demoReply"></span>
</p>
Javascript source:
var services = new dojox.rpc.Service({
target:"../dwr/j ......

ajaxÔ­Àí

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

xmlDoc Ajax¼¼Êõ

 <!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=UTF-8">
<script type="text/javascript&quo ......

VS2005ÖÐajax°²×°Ö¸ÄÏ

 
VS2005ÖÐajax°²×°Ö¸ÄÏ
ÒÔÏÂÊÇÊÕ¼¯¹ØÓÚAjaxControlToolkit°²×°µÄһƪÎÄÕ£¬¸Ðлԭ×÷Õß
AjaxControlToolkitÏÂÔØhttp://ajax.asp.net/downloads/default.aspx?tabid=47
http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=1425
»·¾³ÉèÖÃÈçÏ£º
ÏÂÔØÍê
ASPAJAXExtSetup.msi ° ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ