我需要为来自 php.php 的变量替换值 17:
$(function() {
$("#test").paginate({
count : 17,
start : 1,
display : 12,
border : true
...
});
});
我试过这个(没用):
$(function(){
$("#test").paginate({
count : $.post("php.php",function(result){ console.log(result['count']) }),
start : 1;
display : 12;
border : true
...
});
php.php
$query = mysql_query("SELECT * FROM test");
$count = mysql_num_rows($query);
json_encode($count);
我正在尝试这种方式,但我不知道这是否是最好的方式。我感谢任何建议和帮助。