AJAX 呼び出しを実行しようとしていますが、連想配列を形成しています: dataType: as JSON をリストすると、構文 Error: unexpected tokenが表示されます。data -type HTML で送信すると正常に動作しますが、アクセスできませんdata.success
データ型JSONを送信しない限り、戻り配列のプロパティ。
var participant_information =
{"Username":participant_name,"relation":participant_relation,"action":action};
$.ajax({
url: '<?php echo base_url();?>transaction/manage_participant/',
async: false,
type: 'POST',
data: {participant_information : participant_information},
dataType: 'json',
success: function(data) {
if(data.success) { }
}
PHP
$status['success'] = 'success';
echo json_encode($status);