1. Êó±êÒÆ¶¯´¥·¢µ÷ÓÃJavaScript:
<td onMouseOver="popmenu(this, <%=rsSub("ID")%>)" onMouseOut="menuout(this)" >test </td>
2. JavaScriptµÄ·½·¨ÈçÏÂ:
function popmenu(HeadMenu, intDownSubID)
{
HeadMenu.className = "over";
SubPopMenu.style.top = getposOffset(HeadMenu, "top") + HeadMenu.offsetHeight/2 + 8;
SubPopMenu.style.left = getposOffset(HeadMenu, "left") + HeadMenu.offsetWidth/2-42;
try{
var url = "index.asp?DownSubID=" +escape(intDownSubID);
xmlHttp.open("POST",url,true);
xmlHttp.send(null);
}catch(exception){}
SubPopMenu.style.display = "block";
}
3.XMLHttpµÄÒýÓôúÂëºÜ¼òµ¥ÈçÏÂ:
if (!xmlHttp && typeof XMLHttpRequest != "undefined") {
xmlHttp = new XMLHttpRequest();
}
4.±¾ÉíµÄҳΪΪindex.asp,ΪʲôÓÃ
intSubID = Request("DownSubID") //ÕâÀïÈ¡²»µ½Öµ,Çë´óÏÀÖ¸½Ì.
Response.Write(intSubID)
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange = getData;
xmlHttp.send(null);
function getData()
{
if(xmlHttp.readyState==4 && xmlHttp.status==200) alert(xmlHttp.responseText)
}
°´ÕÕÂ¥Éϵķ½·¨,Ôõô»¹ÊÇÔÚÆä±¾ÉíµÄIndex.aspÈ¡²»µ½ÖµÄØ?
»Øµ÷º¯Êý¸ÄÕâÑùÊÔÊÔ
´ó¼Ò¶¼ÖªµÀ£¬AJAXµÄºÃ´¦ÊÇÎÞÉÁ¾Ö²¿Ë¢Ð£¬°´Ðè´«ÊäÊý¾Ý¼ÓÔØ¿ì£¬¸øÓû§µÄÌåÑéȷʵÊǺá£
µ«ÊÇËü²»Ö§³ÖËÑË÷ÒýÇæ£¬ÕâҲʹµÃAJAXµÄÃûÉùºÜ³ô£¬¿ª·¢ÈËÔ±²»µÃ²»¿¼ÂÇÔÚÓû§ÌåÑéºÍÖ§³ÖËÑË÷Á½·½Ãæ×÷Ȩºâ¡£
ÎÒµÄÒ»¸öÒ³Ãæ ......