2014-07-19, 13:07:02
Hi. This code echo all subpage. How show only 10 subpage and another load after with ajax.How make php function which show subpage (number from ajax). For example ajax:
PHP Code:
function getSubMenu($page){
$children=getChildren($page);
foreach ($children as $subpage){
$title=returnPageField($subpage,'title');
$url=returnPageField($subpage,'slug');
echo '<a href="/'.$url.'.html"> '.$title.'</a>';
}
}
Code:
$.ajax({
type: "POST",
url: "",
context: this,
data: {
'num' : '10'
},
success: function(data){
console.log(data);
},
error: function(data){
console.log('error' + data);
}
});