S
S
smilelan2020-05-12 16:29:42
JavaScript
smilelan, 2020-05-12 16:29:42

How to display error received from laravel in ajax?

Hello! how to display the received error in the view, laravel framework, I get the response with ajax? thanks for the help
image.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-05-12
@aschurf

Whether it's Laravel or not, it doesn't matter.
If you need to display the error text in the template's blade div element, use the standard jQuery tools: You can substitute this into the success or error function after receiving the response from the AJAX request
<div id="divText">MyText</div>
$('#divText').text('yourText');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question