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

AJAX´¦ÀíXMLÎĵµÎÊÌâ

<XML>
<FLAG>1</FLAG>
<REASON></REASON>
<ADVERT><ADID>64</ADID><ADNAME>Ó¢»ÊÓéÀÖËÄ</ADNAME><ADCONTENT>ÄÚÈÝÒ»</ADCONTENT><ADTIME>50.0</ADTIME></ADVERT>
<ADVERT><ADID>66</ADID><ADNAME>Ó¢»ÊÓéÀÖÈý</ADNAME><ADCONTENT>ÄÚÈݶþ</ADCONTENT><ADTIME>51.0</ADTIME></ADVERT>
</XML>
ÎÒÌá½»ÓõÄÊÇPOST·½·¨£¬ÈçÉÏÊÇÌá½»ºó·þÎñÆ÷¶Ë·µ»ØµÄXMLÎı¾£¬ÎÒͨ¹ýÏÂÃæ·½·¨À´»ñÈ¡ÎĵµÄÚÈÝ£¬£º
//AJAXÏìÓ¦´¦Àíº¯Êý
function doProcess(){
  if(xmlHttp.readyState==4){
  if(xmlHttp.status==200){ 
//´´½¨XML¶ÔÏó
var xmlDoc = xmlHttp.responseXML;//²âÊÔxmlDocÊǶÔÏó
//var testStr = xmlHttp.responseText;//testStr ¼´ÎªÉÏÃæ³öÏÖµÄXMLÎı¾
alert(xmlDoc.childNodes[0]);//µ«ÊÇËûµÄ×Ó½ÚµãΪnull
var flag = xmlDoc.getElementsByTagName("ADVERT");
alert(flag.length);//Êä³öΪ0£¬ÎªÊ²Ã´²»ÊÇ1
if(flag[0].firstChild.nodeValue==1){ //ÕâÀï¾ÍÖ±½Ó±¨´í˵¶ÔÏó²»´æÔÚÁË¡£¡£
var reason = xmlDoc.getElementsByTagName("REASON");
alert(reason[0].firstChild.nodeValue);
}

  }
  }
}
Çë°ïÎÒ·ÖÎöÏ£¬ÎªÊ²Ã´µÃµ½µÄ²»ÊÇÎÒÔ¤ÆڵĽá¹û
ÿÌì»ØÌû¼´¿É»ñµÃ10·Ö¿ÉÓ÷Ö

ÊÔÊÔ
var xml = xmlDoc.documentElement;
alert(xml.childNodes.length);

2Â¥µÄ·½·¨ÎÒÓùýµÄ£¬Îª


Ïà¹ØÎÊ´ð£º

AjaxÓëSessionµÄÎÊÌâ - .NET¼¼Êõ / ASP.NET

֮ǰÓöµ½Ò»¸öÎÊÌâ¡£
ÓÚÊÇ×öÁËÒÔÏÂʵÑ飺
Ò³Ãæ¼ÓÔغó£¬Ìá½»Ò»¸öAjaxÇëÇó(ÔݳÆΪajax1)£¬ÇëÇóµÄÏß³ÌÔÚ·þÎñÆ÷Éϱ»Ë¯Ãß10ÃëÖÓ¡£
µã»÷Ò³ÃæÉÏÒ»¸öbutton£¬´¥·¢ÁíÒ»¸öAjaxÇëÇó(ajax2)¡£
µ±Ã»ÓÐʹÓÃsession£¬ÔÚ·þÎñÆ÷δ´ ......

Struts1.2 ½áºÏajax ¿ò¼Ü ÕûºÏÉý¼¶ - Java / Java EE

ÎÒÏÖÔÚÓиöÃÅ»§ÍøÕ¾£¬ÓÃStruts1.2×öµÄ£¬Ö®Ç°Ã»ÓÃajax,ÏÖÔÚÏë½áºÏajax ¿ò¼Ü ÕûºÏÉý¼¶¡£
Struts1.2 ºÍÄǸöajax ¿ò¼ÜÕûºÏµÄ±È½ÏºÃ¡£ÕûºÏÖ®ºóÌý˵ajax Õ¼ÄÚ´æʲô¶¼²»Ð¡£¬°üÒ²²»Ð¡£¬´ó¼ÒÌÖÂÛһϰ¡¡£
ajax ÊÇ¿Í»§¶ËµÄ¶ ......

Êý¾ÝÒÔxml¸ñʽ·µ»Ø - MS-SQL Server / Ó¦ÓÃʵÀý

´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......

ÇóJavaÈçºÎʵÏÖxmlÎļþ

ÒÑÖªÎļþ1.xmlºÍÊý¾ÝÎļþdb.xml£¬ÈçºÎÓÃjava±àд³ÌÐò£¬µÃ³ö2.xmlÎļþ£¿
1.ÒÑÖªxmlÎļþ 1.xml½á¹¹ÈçÏ£º
<cs>
  <cs name="cs1" details="This is cs1" country="China&q ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ