AjaxÌØЧ ¸ù¾ÝÓÊÕþ±àÂë»ñÈ¡µØÇøÐÅÏ¢ Ö®Èý
Óû§²Ù×÷½çÃæpostalcode.html
Ò³ÃæÖаüº¬3¸öÎı¾¿ò£¬·Ö±ð±íʾÓÊÕþ±àÂë¡¢µØÇøºÍ³ÇÊÐÐÅÏ¢¡£µ±Óû§ÊäÈëÓÊÕþ±àÂëºó£¬ÏµÍ³½«×Ô¶¯´Ó·þÎñÆ÷¶ÁÈ¡µØÇøºÍ³ÇÊÐÐÅÏ¢£¬Ìî³äµ½¶ÔÓ¦Îı¾¿òÖС£ÏêϸµÄº¯Êý˵Ã÷Çë²Î¿¼´úÂëÖеÄ×¢ÊÍ¡£
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>¸ù¾ÝÓÊÕþ±àÂë»ñÈ¡Ê¡ÊÐÐÅÏ¢</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script type="text/javascript">
var xmlHttp; //ÓÃÓÚ±£´æXMLHttpRequest¶ÔÏóµÄÈ«¾Ö±äÁ¿
//ÓÃÓÚ´´½¨XMLHttpRequest¶ÔÏó
function createXmlHttp() {
//¸ù¾Ýwindow.XMLHttpRequest¶ÔÏóÊÇ·ñ´æÔÚʹÓò»Í¬µÄ´´½¨·½Ê½
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest(); //FireFox¡¢OperaµÈä¯ÀÀÆ÷Ö§³ÖµÄ´´½¨·½Ê½
} else {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); //IEä¯ÀÀÆ÷Ö§³ÖµÄ´´½¨·½Ê½
}
}
//½öÔÊÐíÊäÈëÊý×Ö
function checkNumber() {
//ÅжÏÊäÈë×Ö·ûµÄkeyCode£¬Êý×ÖÔÚ48~57Ö®¼ä£¬³¬³ö²¿·Ö·µ»Øfalse
if ((event.keyCode >= 48) && (event.keyCode <= 57)) {
event.returnValue = true;
} else {
event.returnValue = false;
}
}
//»ñÈ¡µØÇøÐÅÏ¢µÄµ÷Óú¯Êý
function getPostalCode() {
var pCodeValue = document.getElementById("postalCode").value; //»ñÈ¡ÊäÈëµÄÓÊÕþ±àÂë
//µ±ÊäÈëµÄÓʱ೤¶È¸ÕºÃµÈÓÚ6ʱ£¬ÀûÓÃXmlHttpRequest¶ÔÏóÏò·þÎñÆ÷·¢³öÒì²½ÇëÇó
if (pCodeValue.length
Ïà¹ØÎĵµ£º
ÉÏƪ½éÉÜÁËÈçºÎÔÚAjax¿Í»§¶ËÓë·þÎñÆ÷¶ËÖ®¼ä´«Ëͼòµ¥µÄÎı¾Êý¾Ý£¬Æäʵ£¬Ò²¿ÉÒÔʹÓÃXML×÷ΪÊý¾Ý´«ËÍ¡¢¹µÍ¨µÄ¸ñʽ£¬Ajax¿Í»§¶ËÈôÒª·¢ËÍXML£¬»ù±¾ÉϾÍÊǽ«XML×÷Ϊ×Ö·û´®£¬ÔÚPOSTÇëÇóʱ·¢ËÍ£¬ÀýÈ磺
*HelloAjax.js
var xmlHttp;
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
xmlHttp = new ......
jQuery ÊÇÒ»¸öJavaScript ¿â£¬ËüÓÐÖúÓÚ¼ò»¯ JavaScript™ ÒÔ¼° Asynchronous JavaScript + XML (Ajax) ±à³Ì¡£ÓëÀàËÆµÄ JavaScript ¿â²»Í¬£¬jQuery ¾ßÓжÀÌصĻù±¾ÔÀí£¬¿ÉÒÔ¼ò½àµØ±íʾ³£¼ûµÄ¸´ÔÓ´úÂ롣ѧϰ jQuery »ù±¾ÔÀí£¬Ì½Ë÷ÆäÌØÐԺ͹¦ÄÜ£¬Ö´ÐÐһЩ³£¼ûµÄ Ajax ÈÎÎñ²¢ÕÆÎÕÈçºÎʹÓòå¼þÀ©Õ¹ jQuery¡£
jQuery ÊÇʲ ......
var xmlHttp;
function createXMLHttpRequestss() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest) {
& ......
Ajax
Ò».×ÊÔ´ÀàÍøÕ¾
1,¹úÄÚÍøÕ¾
1)AjaxÖйú(ÍƼö)
Ò»¸öרҵµÄajax¼¼ÊõÍøÕ¾,·ÖÀàÇåÎú,ÓдóÁ¿µÄµç×Ó°æ½Ì³Ì,ÒÔ¼°AJAXÔ´ÂëÏÂÔØ!
www.okajax.com
2)ajaxcn.org
ÀîçûÀÏʦµÄblog¡£Àîçû:¡¶ajaxʵս¡·ÒëÕß.
www.ajaxcn.org
-----------------------------------------
2,¹úÍâÍøÕ¾
1)¡¢AjaxµÄµ®Éú
Ajax:ANewApproachtoWeb ......
ÔںܶàϵͳÖУ¬ÐèÒªÓû§Ìîд¸öÈË×ÊÁÏ£¬ÆäÖаüº¬µØÇø¡¢³ÇÊС¢ÓÊÕþ±àÂëµÈÐÅÏ¢¡£¶øÓÊÕþ±àÂë±¾Éí°üº¬Á˵ØÇøºÍ³ÇÊÐÐÅÏ¢£¬ËùÒÔ¿ÉÒÔÀûÓô˹æÔò¼ò»¯²Ù×÷¡£Óû§Ö»ÐèÒªÊäÈëÓÊÕþ±àÂ룬ϵͳ¸ù¾ÝÓÊÕþ±àÂë×Ô¶¯È¡µÃµØÇøÐÅÏ¢¡£ÕâÑù×öʹµÃÓû§¿ÉÒÔ»ñµÃ¸üºÃµÄʹÓÃÌåÑ飬Ҳ¿ÉÒÔ¼õÉÙ´íÎóµÄ·¢Éú¡£
ҪʵÏÖ×Ô¶¯»ñÈ¡µØÇøÐÅÏ¢£¬Ö÷Òª¿¼ÂÇ3¸öÎÊÌ ......