html+php+jave script一个问题 我想在一个表格里点击某行记录,然后表格上方或下方显示另外一个表格显示该记录详细信息。如何做?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那就看详细信息的量是多少了,我觉得如果量比较少的话,就直接放在一个地方,隐藏起来就好了,单击表格触发一个事件,显示信息就好了。如果量比较大的话,就单击表格触发一个ajax请求,把数据请求过来,再用dom操作,显示详细信息 找本书看。http://club.topsage.com/thread-2216652-1-1.html <!-- a.html --><script src="a.js"></script><a onclick="tophp()">详细信息</a><div id="show"></div>//a.jsvar xmlHttp; function createXMLHttpRequest() { if(window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } /* ------------------- route list ------------------- */ function routeList(){ createXMLHttpRequest(); url = "a.php?&ran="+Math.random(); method = "GET"; xmlHttp.open(method,url,true); xmlHttp.onreadystatechange = showList; xmlHttp.send(null); } function showList(){ if (xmlHttp.readyState == 4){ if (xmlHttp.status == 200){ var text = xmlHttp.responseText; document.getElementById("show").innerHTML = text; }else { alert("response error code:"+xmlHttp.status); } } }<?php$a = 1;$b = "abc";$c = "123abc";?><table> <tr><td><?=$a?></td></tr> <tr><td><?=$b?></td><td><?=$c?></td></tr></table> php访问web service总出乱码 求助!smarttemplate应该怎么配置? php5 注入漏洞问题 php url参数问题 怎样防止一个用户名重复登陆 一个数组的转换 php发送电子邮件问题 怎么打不开oracle的扩展库? 我们的ipb测试论坛开通,欢迎来测试 file_get_contents post执行后 程序自动离开??? MySQL的Update的使用 怎么对一片文章进行分页,就是对每页限制显示多少字数那样
如果量比较大的话,就单击表格触发一个ajax请求,把数据请求过来,再用dom操作,显示详细信息
http://club.topsage.com/thread-2216652-1-1.html
<!-- a.html -->
<script src="a.js"></script>
<a onclick="tophp()">详细信息</a>
<div id="show"></div>
//a.js
var xmlHttp; function createXMLHttpRequest() {
if(window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
} /* ------------------- route list ------------------- */
function routeList(){
createXMLHttpRequest();
url = "a.php?&ran="+Math.random();
method = "GET";
xmlHttp.open(method,url,true);
xmlHttp.onreadystatechange = showList;
xmlHttp.send(null);
} function showList(){
if (xmlHttp.readyState == 4){
if (xmlHttp.status == 200){
var text = xmlHttp.responseText;
document.getElementById("show").innerHTML = text;
}else {
alert("response error code:"+xmlHttp.status);
}
}
}
<?php
$a = 1;
$b = "abc";
$c = "123abc";
?>
<table>
<tr><td><?=$a?></td></tr>
<tr><td><?=$b?></td><td><?=$c?></td></tr>
</table>