Òþ²ØÓò·½Ê½µÄAjaxʵÏÖ
xmlHttpÐÎʽµÄAjax£ºXmlHttpÐÎʽµÄAjax IBM¼¼ÊõÎĵµ¿â
ÒÔÏÂÊÇÀûÓÃÒþ²ØiframeʵÏÖµÄajax:
index.htm
<html>
<head>
</head>
<body>
<iframe id="testFrame" frameborder="0" style="width:0px; height:0px;">
</iframe>
<div id="resultCase">
</div>
<input type="button" value="showResult" onclick="AjaxGo();" />
</div>
<script type="text/javascript">
function AjaxGo()
{
document.getElementById("testFrame").src = "ajax.htm";
}
function ShowResult()
{
document.getElementById("resultCase").innerHTML = "hello world !";
}
</script>
</body>
</html>
ajax.htm
<html>
<head>
</head>
<body>
<script type="text/javascript">
parent.ShowResult();
</script>
</body>
</html>
Ïà¹ØÎĵµ£º
xmlÊý¾Ý£º
writer.write("<root>" +
"<name>a</name>" +
"<name>b</name>"+
"</root>");
ǰ̨½âÎö£º
request.onreadystatechange=function(){
if(request.readyState==4){
var x=requ ......
AjaxÈ«³ÆΪ“Asynchronous JavaScript and XML”£¨Òì²½JavaScriptºÍXML£©£¬ÊÇÒ»ÖÖ´´½¨½»»¥Ê½ÍøÒ³Ó¦ÓõÄÍøÒ³¿ª·¢¼¼Êõ¡£¸ù¾ÝAjaxÌá³öÕßJesse James Garrett½¨Ò飬Ëü£º
ʹÓÃXHTML+CSSÀ´±íʾÐÅÏ¢£»
ʹÓÃJavaScript²Ù×÷DOM£¨Document Object Model£©½øÐж¯Ì¬ÏÔʾ¼°½»»¥£»
ʹÓÃXMLºÍXSLT½øÐÐÊý¾Ý½»»»¼°Ïà¹Ø²Ù×÷£»
Ê ......
Web¿ª·¢Õß²»»á×¢Òâµ½ÓÉ “AJAX(Asynchronous JavaScript And
XML)”Ëù´øÀ´µÄ¼¤Çé¡£²»·ÑÁ¦Æø¾ÍÄÜ´´½¨ÏñGoogle
SuggestÄÇÑùµÄÖÇÄÜÍøÕ¾»òÕßÏñGmailÄÇÑù»ùÓÚWebµÄÓ¦ÓóÌÐò£¬ÕâÔںܴó³Ì¶ÈÉÏÒª¹é¹¦ÓÚÕâÖÖ¼¼Êõ¡£È»¶ø£¬°éËæ×ÅAJAXÓ¦ÓóÌÐòµÄ·¢Õ¹£¬ÎÒÃÇ·¢
ÏÖÁËËüµÄһЩ²»×ãÖ®´¦£¬ÎÒÃÇ·¢ÏÖËüµÄ°²È«Â©¶´Ò²ÔÚÖð½¥±ä´ó£¬¾ÍÏ ......
ajax¿çÓòºÍJSµÄ¿çÓòͨÐÅ(Cross The Site)µÄ¼¸ÖÖ½â¾ö·½°¸
×î½ü×öµÄÒ»¸öÏîÄ¿ÖÐÐèÒªajax¿çÓòÈ¡µÃÊý¾Ý,Èç¹ûÊÇÔÚ±¾ÓòÖÐȷʵûÓÐÎÊÌ⣬µ«ÊǷŵ½¶þ¼¶ÓòºÍÆäËûÓòÏÂä¯ÀÀÆ÷Ö±½Ó¾Íµ¯³öÌáʾ¿ò:“¸ÃÒ³ÕýÔÚ
1.ʲôÒýÆðÁËajax¿çÓò²»ÄܵÄÎÊÌâ
ajax±¾Éíʵ¼ÊÉÏÊÇͨ¹ýXMLHttpRequest¶ÔÏóÀ´½øÐÐÊý¾ÝµÄ½»»¥£¬¶øä¯ÀÀÆ÷ ......
AJAX±íµ¥Ìá½»·½·¨£¨JSON£©
1./*****JAVA**************************************************************/
JAVAÀàÖУº
/*****JAVA**************************************************************/
2./*****struts.xml**************************************************************/
struts.xmlÎļþÖУº
......