就是鼠标移动到gridview的某一行,通过行的id显示详细信息 这个效果是纯JS,信息内容用ajax获取 <tr onmouseover="showdetails(3)"></tr>//gridview编译后的html function showdetails(id) { var url = "getdata.aspx?id="+id; var req = getAjax(); req.open("GET", url, true); req.onreadystatechange = function(){ if(req.readyState==4){ var re = req.responseText;//获取返回的内容 } }; req.send(null); } function getAjax() { var oHttpReq = null; if(window.ActiveXObject) oHttpReq = new ActiveXObject("MSXML2.XMLHTTP"); else if(window.createRequest) oHttpReq = window.createRequest(); else oHttpReq = new XMLHttpRequest(); return oHttpReq; } |
|