ajaxµ¯³öÌáʾÐÅÏ¢
ajaxµ¯³öÌáʾÐÅÏ¢
1¡¢ ÊäÈëÓò£º
<h2>¹¤¾ßÌáʾ</h2>
<hr>
<a href="#" onmouseover="over(0)" onmouseout="out()">ÎïÆ·Ò»</a><br><br>
<a href="#" onmouseover="over(1)" onmouseout="out()">ÎïÆ·¶þ</a><br><br>
<a href="#" onmouseover="over(2)" onmouseout="out()">ÎïÆ·Èý</a><br><br>
<div id="tip" style="position:absolute;display:none;border:1px;border-style:solid;">
<table id="tipTable" border="0" bgcolor="#ffffee">
<tr align="center">
<td><img id="photo" src="" height="80" width="80"></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</div>
2¡¢ JavaScript½Å±¾£º
<script type="text/javascript">
var xmlHttp;
var x, y; //¼Ç¼Ê¼þ·¢ÉúʱµÄÊó±êλÖÃ
//´´½¨XMLHttpRequest¶ÔÏó
function createXMLHttpRequest() {
if(window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else if (window.XMLHttpRequest) {
&nb
Ïà¹ØÎĵµ£º
ÔÚ¿´ÎÄÕÂÇ°£¬ÏÈÖ¸¶¨Ò»¸öͨÓõıäÁ¿xhr£¬xhr´úÂëajax¶ÔÏó¡£
²âÊÔä¯ÀÀÆ÷£ºieΪie6£¬firefoxΪ2£¬ÆäËûµÄδ²âÊÔ¡£Í³³Æie6Ϊie£¬firefox2Ϊff¡£
»ù±¾µÄ
1£¬×î¾µäµÄ¾ÍÊÇieϵĻº´æÎÊÌâÁË¡£
Èç¹ûʹÓõÄÊÇget£¬ÄÇôÔÚieϳöÏÖ»º´æÎÊÌâ¡£µ¼Ö´úÂëÖ»Ö´ÐÐÒ»´Î¡£½â¾ö°ì·¨¾ÍÊǼÓʱ¼ä´Á»òÕßËæ»úÊý£¬Ê¹url±äΪΨһ£¬ÕâÑù¾Í²»»á³öÏÖ ......
±¾ÎÄÄÚÈÝÕª×Ô£º¡¶Java Web¿ª·¢½Ì³Ì——ÈëÃÅÓëÌá¸ßƪ£¨JSP+Servlet£©¡·
½»»¥µÄ»ù±¾¹ý³Ì°üÀ¨£º
l ´´½¨XMLHttpRequest¶ÔÏó£»
l ·¢ËÍÇëÇó£»
l ´¦ÀíÏìÓ¦¡£
´ ......
Ôø¾¶ÔajaxºÜºÃÆ棬ÿ´ÎºÍͬѧ»òÕßͬÊÂ̸ÆðajaxÌýËûÃÇÔÚÄÇÇáÃèµÐ´Ò»·¬²»ÖªËùÒÔÈ»£¬Ç°¼¸Ìì²é×ÊÁϲŻíÈ»Ã÷°×¡£ÏÂÃæÖ±ÈëÕýÌ⣺
Ajax »ù±¾ÉϾÍÊÇ°Ñ JavaScript ¼¼ÊõºÍ XMLHttpRequest
¶ÔÏó·ÅÔÚ Web
±íµ¥ºÍ·þÎñÆ÷Ö®¼ä
¡£µ±Óû§Ìîд±íµ¥Ê±£¬Êý¾Ý·¢Ë͸øһЩ JavaScript ´úÂë¶ø²»ÊÇ
Ö±½Ó·¢Ë͸ø·þÎñÆ÷¡£Ïà·´£¬JavaScript
......
ajax½øÐÐÓû§µÄÓÐЧÐÔ¼ì²âʾÀý
1¡¢ ÊäÈëÓò£º
»áÔ±µÄÓÐЧÐÔ¼ì²é£º
<input type="text" name="username"> <input type="button" value="¼ì²é" onclick="return check();">
2¡¢ JavaScript½Å±¾£º
var xmlHttp;
//´´½¨XMLHttpRequest ......