第二步:通过ajax遍历出对应的分类
$('.gao_title dd a').click(function(){
$('.gao_title dd a').parent('dd').parent('dl').children('dt').children('span').removeClass('c_java');
$(this).parent('dd').parent('dl').children('dt').children('span').addClass('c_java');
$('.gao_title dd a').removeClass('erdan');
$(this).addClass('erdan')
$("#j_title").text($(this).parent('dd').parent('dl').children('dt').text());
$("#j_s").text($(this).html());
$(".t_gao span").text($(this).html());
$.ajax({
type:'get',
url:'ajax.php?catid='+$(this).attr('to'),
//dataType:'json',
success:function(msg){
//alert(msg);
$('.t_gao dl').html(msg);
}
});
})
PS:ajax.php中的:
header("Content-Type: text/html; charset=utf-8");
define('DT_REWRITE', true);
require '../common.inc.php';
$i=1;
$A = array();
//$result = $db->query("select * FROM weixin_category where parentid=".$_GET['catid']."'order by catdir desc'");
$result = $db->query("select * FROM weixin_category where parentid='$_GET[catid]' order by catdir desc");
while($r = $db->fetch_array($result)) {
?>
to="">
$i++;}
?>
第三步:遍历内容
contect.php中的内容
header("Content-Type: text/html; charset=utf-8");
define('DT_REWRITE', true);
require '../common.inc.php';
$result = $db->query("select * FROM weixin_down_31 where catid='$_GET[catid]' order by itemid desc");
while($r = $db->fetch_array($result)) {
?>