ÓÃAJAXµ÷ÓÃXMLʱ¾¹È»²»ÄÜ°üº¬ÈκηûºÅ
ÎÒÓÃActiveXObject("Microsoft.xmldom")À´×°ÔØxmlÎĵµÊ±£¬¾¹È»ÀÏÊÇÌáʾװÔØʧ°Ü£¬ºóÀ´ÉÏÍøËÑË÷ÁËÏ£¬ËµÊDz»ÄÜÖ±½Ó°üº¬Õâ5¸ö·ûºÅ£¨'><&"£©£¬±ØÐëÑ¡ÓÃ&xx;·½Ê½À´×ªÒ壬¿ÉÎÒÕÒ±éXMLҲû·¢ÏÖÕâЩ¡£
ºóÀ´ÎÒ¶ÀÐÐÅųý£¬²Å·¢ÏÖÓÐÒ»¸öÔªËصÄÊôÐÔֵΪÓГ|”£¬È¥³ýºó¾ÍÕý³£ÁË¡£ÎÒÕæÊǾõµÃÆæ¹Ö£¬ÍøÉÏҲûÓÐ˵²»ÄÜ°üº¬Õâ¸ö·ûºÅѽ¡£
ºóÀ´ÎÒÔÙÖðһȥ³ýXMLÖеÄÍ·²¿ÉùÃ÷£¬·¢ÏÖÖ»ÒªÊÇÔÚÍ·²¿¼ÓÉÏÁË<!DOCTYPE>£¬¾Í²»ÄÜ´æÔÚÈκηûºÅ£¡
Ïà¹ØÎĵµ£º
/*
κÑÔAJAX Àà
ʹÓ÷½·¨:
<mce:script type="text/javascript"><!--
var classAjax = new Ajax(sUrl,sRecvTyp,sQueryString,oResultFunc);
classAjax.post();//post·½Ê½·¢ËÍÊý¾Ý
classAjax.get();//get·½Ê½·¢ËÍÊý¾Ý
//sUrl·¢Ë͵ØÖ·
//sRecvTyp ½ÓÊÜÊý¾ÝÀàÐÍ:0Ϊxml 1Ϊtext
//oResultFunc ·µ»Ø½á¹û´¦Àíº ......
ajax½øÐÐÓû§µÄÓÐЧÐÔ¼ì²âʾÀý
1¡¢ ÊäÈëÓò£º
»áÔ±µÄÓÐЧÐÔ¼ì²é£º
<input type="text" name="username"> <input type="button" value="¼ì²é" onclick="return check();">
2¡¢ JavaScript½Å±¾£º
var xmlHttp;
//´´½¨XMLHttpRequest ......
Õâ¸öÀý×ÓÒª°Ñbookstore.xmlÎļþÔö¼ÓÒ»Ìõbook¼Ç¼
1 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="love" ISBN="1234123">
<title>who am i </title>
<author>who</author>
  ......
AjAx.js
var bCheckUserPass = false;
var StrType;
function checkUsers(StrTmp)
{
var oB = window.document.all.nam
StrType=StrTmp
if (oB.length == 0) re ......