我现在碰到的问题是,取不出 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>

解决方案 »

  1.   

    没用过wBox,不知道它的用法,不过可以用jquery来得到链接嘛,
    <script type="text/javascript"> 
       $("a.ajax").wBox({
        requestType: "ajax",
        target:$(this).attr("href")
       });
    </script>
      

  2.   

    楼上的方法我试了,没有达到效果。Thanks all the same!我觉得和wbox关系不大,wbox只是实现弹出层,并用ajax来加载页面而已。最关键的是这两个地方:td><a class="ajax" href="more.php?id=421181199400000001">查看</a></td>
    <script type="text/javascript">  
      $("a.ajax").wBox({
      requestType: "ajax",
      target:$(this).attr("href")
      });
    </script>
    我是想要实现:点击“查看”链接后,弹出一个层,加载页面 more.php,通过取出的 $_GET['id']从数据库读取数据。
      

  3.   

    我不知道你的wbox是什么东西,但是用jquery的:$(this).attr("href")就是能获取链接的值:<script type="text/javascript"> 
    $("a.ajax").click(function(){ 
      alert($(this).attr("href")); 
      return false;
    });   $("a.ajax").wBox({
        requestType: "ajax",
        target:$(this).attr("href")
       });
    </script>
      

  4.   

    我拿你的代码测试了,确实直接读取链接有问题,可能是wBox不能处理特殊符号,如?号.号,改成这样就没问题:<script type="text/javascript"> 
       $("a.ajax").wBox({
        requestType: "ajax",
        target:"more.php?"+$(this).attr("href")
       });
    </script>然后链接改成这样:<a class="ajax" href="112181199400000001">查看</a>
      

  5.   

    我再测试在wbox里面用jquery读取不了值,我查了一下wbox,你这样写吧。$(document).ready(function(){
    $("a.ajax").click(function(){  
     $(this).wBox({
      requestType: "ajax",
      show:true,
      target:$(this).attr("href")
      });
     return false;
    });
    });