我现在碰到的问题是,取不出 more.php?id=xxxx 的值,导致任何弹出框显示的都是相同的内容。请问,怎么解决?谢谢!<html>
<head>
<title>测试</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.js8.in/wbox/wbox/wbox.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.js8.in/wbox/wbox/wbox.css" />
</head>
<body>
<style type="text/css">
table,tr,td{font-size:14px;line-height:25px;text-align:center;}
</style>
<table border="1" align="center">
<tr bgcolor="#9acd32">
<td>学号</td><td>姓名</td><td>性别</td><td>籍贯</td><td>民族</td><td>出生年月</td><td>身份证号</td><td>详情</td>
</tr>
<tr>
<td>101</td><td>姓名01</td><td>男</td><td>湖北</td><td>汉族</td><td>1994年1月</td><td>421181199400000001</td><td><a class="ajax" href="more.php?id=421181199400000001">查看</a></td>
</tr>
<tr>
<td>102</td><td>姓名02</td><td>男</td><td>湖北</td><td>汉族</td><td>1994年1月</td><td>421181199400000004</td><td><a class="ajax" href="more.php?id=421181199400000004">查看</a></td>
</tr>
</table><br /><br />
<script type="text/javascript">
$("a.ajax").wBox({
requestType: "ajax",
target:"more.php"
});
</script>
</body>
</html>
<head>
<title>测试</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.js8.in/wbox/wbox/wbox.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.js8.in/wbox/wbox/wbox.css" />
</head>
<body>
<style type="text/css">
table,tr,td{font-size:14px;line-height:25px;text-align:center;}
</style>
<table border="1" align="center">
<tr bgcolor="#9acd32">
<td>学号</td><td>姓名</td><td>性别</td><td>籍贯</td><td>民族</td><td>出生年月</td><td>身份证号</td><td>详情</td>
</tr>
<tr>
<td>101</td><td>姓名01</td><td>男</td><td>湖北</td><td>汉族</td><td>1994年1月</td><td>421181199400000001</td><td><a class="ajax" href="more.php?id=421181199400000001">查看</a></td>
</tr>
<tr>
<td>102</td><td>姓名02</td><td>男</td><td>湖北</td><td>汉族</td><td>1994年1月</td><td>421181199400000004</td><td><a class="ajax" href="more.php?id=421181199400000004">查看</a></td>
</tr>
</table><br /><br />
<script type="text/javascript">
$("a.ajax").wBox({
requestType: "ajax",
target:"more.php"
});
</script>
</body>
</html>
<script type="text/javascript">
$("a.ajax").wBox({
requestType: "ajax",
target:$(this).attr("href")
});
</script>
<script type="text/javascript">
$("a.ajax").wBox({
requestType: "ajax",
target:$(this).attr("href")
});
</script>
我是想要实现:点击“查看”链接后,弹出一个层,加载页面 more.php,通过取出的 $_GET['id']从数据库读取数据。
$("a.ajax").click(function(){
alert($(this).attr("href"));
return false;
}); $("a.ajax").wBox({
requestType: "ajax",
target:$(this).attr("href")
});
</script>
$("a.ajax").wBox({
requestType: "ajax",
target:"more.php?"+$(this).attr("href")
});
</script>然后链接改成这样:<a class="ajax" href="112181199400000001">查看</a>
$("a.ajax").click(function(){
$(this).wBox({
requestType: "ajax",
show:true,
target:$(this).attr("href")
});
return false;
});
});