Я буду называть translationRecord как Ajax, когда он мне понадобится. Однако перед запросом возникает ошибка, поскольку значение отсутствует. Вот почему я хочу знать, как сделать исключение.
@if(isset($translationRecords))
@foreach($translationRecords as $translationRecord)
<tr>
<td id="recodeValue{{ $translationRecord->id }}" style="display:none">{{ $translationRecord->id }}</td>
<td>{{ $translationRecord->korean }}</td>
<td>{{ $translationRecord->japanese }}</td>
<td><button id="recodeRemoveBtn{{ $translationRecord->id }}" type="button" class="btn btn-danger float-right">삭제</button></td>
</tr>
@endforeach
@endif
Я всегда хочу загрузить страницу, которая не является компонентом, нажмите кнопку для этих данных.
$(document).ready(function() {
$.ajax({
url: '{{route('translation.recodes')}}',
type: 'post',
data: {_token: "{{ csrf_token() }}"},
success: function (data) {
console.log('ok');
}, error: function () {
alert("error!!!!");
}
});
});
" $ translationRecords "
это настоящее, этот код ajax не всегда может получить данные.