Populate numbered buttons with jquery $ .post ()
I am using jquery $.post()
to call data. Everything works fine. My question is, how can I create buttons for the amount of data returned?
var i = 0;
$.post('getFruits.php',
{
category:fruits
},
function(data){
i++;
+= '<button type="button" class="small">i</button>';
});
PHP:
$data['pages'] = $pgs;
echo json_encode($data);
+3
source to share