ajax - return multiple json encoded array from the server -
ajax - return multiple json encoded array from the server -
i want know how can homecoming multiple encoded json array server
ex.
//client
$.ajax({ url: 'items-details.php', type: 'post', data: {member_id: 1}, datatype: 'html', success: function(responsetext) { } });
//server, items-details.php
//some code here
then, final output ex. itemsdata array , itemscategories array, utilize json_encode() on both array. how can homecoming both arrays client? know how handle echo() - treated client string
before, utilize
echo(json_encode(itemsdata));
then client parse .. how can homecoming multiple json encoded array: itemsdata , itemscategories
for example, create let's $response
array, contain both $itemsdata
, $itemscategories
arrays.
// $itemsdata , $itemscategories defined here $response = array( $itemsdata, $itemscategories ); homecoming json_encode($response);
ajax json
Comments
Post a Comment