How do you do this in laravel 5.6 with javascript.
Plain javascript, Vue, jquery, react, angular,..
What code have you tried so far.
You will need ajax to make a call to the database to retrieve the data.
Have you taken any javascript ajax tutorials prior. Ajax just returns data you can work with however you need.
As example bringing up data to edit:
https://drive.google.com/file/d/0B1_PFw--3o74TC16eXRBYXZBNFk/view
A basic jquery response takes this form:
<script>
$(function () {
$("#testme").click(function (event)
{
event.preventDefault();
var somevar = '3'; // Usually a variable generated by you
// for demo hard coded
$.ajax({
url: 'testg',
type: 'GET',
data: 'somevar=' + somevar,
dataType: 'json',
success: function (data) {
$.each(data, function (index, item) {
alert(item.dogname);
// loop and do whatever with data
});
},
error: function (err) {
alert(err);
}
});
});
});
</script>