·ÖÎö¸üΪ¸´Ô XML »áʹÓÃÈçÏ´úÂëµü´úÔªËØ£º
for (i=0;i<elements.length;i++) {for (j=0;j<elements[i].childNodes.length;j++) {var ElementData = elements[i].childNodes[j].firstChild.nodeValue; } } ½áºÏʹÓà XMLHttpRequest ºÍ HTMLÇë×¢Ò⣬ͨ¹ý XMLHttpRequest »ñµÃ XML ÏìÓ¦ÎÞÐè×ÜÊǸñʽÁ¼ºÃºÍÓÐЧ¡£Òò´Ë£¬AJAX ·þÎñÆ÷¶Ë×é¼þ¿ÉÒÔÖ±½Ó½« HTML ÄÚÈÝ·¢ËÍÖÁ¿Í»§¶Ë¡£È»ºó£¬JavaScript ¿ÉʹÓà req.responseText ·½·¨/ÊôÐÔ£¨ËüÖ»Êǽ«ÄÚÈÝ×÷Ϊ×Ö·û´®½øÐмìË÷£©¼ìË÷¸Ã HTML ÄÚÈÝ¡£¿ÉÒÔʹÓøà HTML ×Ö·û´®Îı¾ÒÔÈκη½Ê½¸ü¸ÄÒ³Ãæ¡£ÀýÈ磬¶ÔÓÚÒÔÏ HTML Á÷£º
<h2>Hello there!</h2><p> This is <b>HTML</b></p>
¿ÉʹÓÃÒÔÏÂÓï¾ä¼ìË÷ÖÁÒ»¸ö×Ö·û´®ÖУº
var HTMLcontent = req.responseText;Ö®ºóͨ¹ý Ìí¼ÓÖÁÖ¸¶¨µÄ HTML DIV¡£
document.getElementById("div1").innerHTML += HTMLcontent;JSF ÈçºÎÖ§³Ö AJAX
JSF ¼°ÆäÒÔ×é¼þΪÖÐÐĵÄÌåϵ½á¹¹Í¨¹ýÔÊÐí JSF ×é¼þȫȨ´¦Àí Javascript ºÍǶÈëʽ AJAX“¹Ü¼þ”½â¾öÁË AJAX µÄ¹ÌÓÐÄÑÌâ¡£JSF Ò³Ãæ×÷ÕßÉõÖÁÎÞÐè¹Ø×¢¿Í»§¶ËÓë·þÎñÆ÷Ö®¼äµÄ AJAX ½»»¥¡£ËüÃÇÖ»ÐèÏñʹÓÃÆäËû JSF ×é¼þÄÇÑùʹÓÃÖ§³Ö AJAX µÄ JSF ×é¼þ¼´¿É£¬¶øÇҸоõ¸üºÃ¡£JSF Óë AJAX µÄ½áºÏʹÓÃǰ;¹âÃ÷£¡
±£³Ö¹Ø×¢£¡
Chris Schalk [ÍøÖ¾] ÊÇ Oracle Ó¦Ó÷þÎñÆ÷ºÍ¿ª·¢¹¤¾ß²¿ÃŵÄÊ×ϯ²úÆ·¾ÀíºÍ Java ÍƹãÕß¡£Chris Ö÷¹¥ Web Ó¦ÓóÌÐò¿ª·¢£¬²¢¸ºÔðΪ Oracle JDeveloper Öƶ¨ Web ¿ª·¢×¼Ôò¡£Trackback: ?PostId=778284
Ïà¹ØÎÄÕ£º
¡¡