function getData(page){
alert('ok');
 $.ajax({
 type:'post',
 url:'action/test.php',
data: {'pageNum':page-1},
beforeSend:function(){
$("#sss ul").append("<li id='loading'>loading...</li>");
},
success:function(json){
$("#sss ul").empty();
total = //获得来自php的变量$a
pageSize = //获得来自php的变量$b
curPage = //获得来自php的变量$c
totalPage = //获得来自php的变量$d
data=//绑定从php的组装的html
//绑定从php的组装的html
 $("div#sss").html(data);
},
complete:function(){ //生成分页条
getPageBar();
},
error:function(){
alert("数据加载失败");
}
});
}

解决方案 »

  1.   

    return "$result,$a,$b";success:function(json){
                a = json.split(',');
      

  2.   

    function html($select,$name){
    global $pagecon;
    $a='1';
    $b='2';
    $result='';
    $result.='<ul id="thumbs">';
    while($row=$select->fetch()){
    $result.='<li class="'.$name.'isotope-item">';
    $result.='<img src="ztImg/'.$row['riseimg'].'"width=235 height=300 alt=""//></div><ul>';
    $result.='<h3 class="title">'.$row['ztname'].'</h3>';
    $result.='<span class="category">'. $row['zttype'].'</span>';    
    $result.='<p class="intro">推荐日期:'.$row['zttime'].'</p></div></li>';
        }
    $result.='</ul>';
    $result.='<center><h4>'.$pagecon.'</h4></center>';
    return $result.'--'.$a.'--'.$b;//用--来连接返回
    }function getData(page){
            alert('ok');
         $.ajax({
         type:'post',
         url:'action/test.php',
        data: {'pageNum':page-1},
            beforeSend:function(){
                $("#sss ul").append("<li id='loading'>loading...</li>");
            },
            success:function(json){
                var arr=json.split('--');
                $("#sss ul").empty();
                result = arr['0']//获得来自php的变量$result
                total = arr['0']//获得来自php的变量$a
                pageSize = //获得来自php的变量$b
                 $("div#sss").html(data);
            },
            complete:function(){ //生成分页条
                getPageBar();
            },
            error:function(){
                alert("数据加载失败");
            }
        });
    }希望能帮助你!
      

  3.   


    $a='1dfvfd';
    $b='2213ergegr';
    $Qnap='<html><a>你好</a></html>>';echo $a,$b,$Qnap;<script type="text/javascript">
    $(document).ready(function(){
    $("#ajax").bind("click",ajax);
    function ajax(){
    $.ajax({
    type:"POST",
    url:"./1.php",success:res
    });
    }
    function res(data){
    var a=json.split(',');
    alert(a);

    $("#red").html(data);
    }
    });
    </script>
    <input type="button" id="ajax"  value="确定">
    <div id="red" class="red"></div>alert不出来
      

  4.   


    这样的话 就全alert出来了
      

  5.   


    抱歉啊...echo 没加双引,好了 谢谢你!