Response title
This is preview!
$.ajax({ dataType: 'JSON', data: { string_1:string_1, string_2:string_2 }, type: 'POST', url:url, success: function(data) { $('.div_1').html(data.string_1); $('.div_2').html(data.string_2); } });
PHP (I receive the above code as the following):
$string_1 = $_POST['string_1']; $string_2 = $_POST['string_2']; $json_arr = array( 'string_1'=>$string_1, 'string_2'=>$string_2 ); echo json_encode($json_arr);
© 2013 jQuery Foundation
Sponsored by and others.