Is it possible with getJSON, to pass 2 different arrays?
$.getJSON('<?php echo $_SERVER['SCRIPT_NAME']; ?>', {
ajax: 'ajax_article_partlist' ,
parent_article: $('#selected_article').val()
},
function(data) {
$('#articles').html('');
$('#article_table').show('slide');
for (var i = 0; i < data.length; i++) {
$('#articles').append("<p>"+data[i]+"</p>");
}
});
this is my request ,on php side i echo and array. But i got now a second array i have to pass in same request. So is that possible, or do i have to make a new getJSON?
php code:
case 'ajax_article_partlist' :
header('Content-type: application/json');
$form->addFormField(new FW_HTML_Form_Request('parent_article'));
$form->resolveRequest();
$parent_article = $form->getValue('parent_article');
$part_list =$db_obj->getFormatedPartList($parent_article);
$db_obj->checkArticleProgram($parent_article);
echo json_encode($part_list);
include($_SERVER['DOCUMENT_ROOT'].'/inc/includes/cms.footer.inc');
exit;
break;
Here are array syntax details: http://www.php.net/manual/en/language.types.array.php
And than in getJSON success function: