I'm using ajax to make a pager. I'm passing the "pag" variable through the url page.
//Initialise the table at the first run
$( '#content' ).load( "paginator.php?pag=1", function()
{
hide_anim();
});
//Page navigation Click
$( document ).on( 'click', 'li.goto', function()
{
//Get the id of clicked li
var pageNum = $(this ).attr('id');
//Loading Data
$( "#content" ).load( "paginator.php?pag=" + pageNum, function()
{
hide_anim();
});
});
Now I'd like to pass also a variable that contains an array. You can do it?
My array
$src = array (’name’ => ‘foo’, ‘sname’ => ‘’, age => '22');
Otherwise I could do the same thing (load) using post? How could I do that? Thanks
EDIT
I did it this way.
//Loading Data
$( "#content" ).load( "paginator.php", { pag: pageNum, phparr=?? }, function()
{
hide_anim();
});
Now, how can I get the array from php and pass it as a jquery variable (phparr) ? Thanks