I’m trying to route directly to the route with ajax in Laravel, but I’m getting an error. I’m taking my first crack at Ajax with jQuery. I’m getting my data onto my page, but I’m having some trouble with the JSON data that is returned for Date data types. Basically, I’m getting a string back that looks like this: /Date(1224043200000)/ From someone totally new.
$(document).ready(function() {
var delayInMilliseconds = 3000;
var url = '{{ route('urun_durum_kontrolu') }}';
var data = {
"_token": '{{ csrf_token() }}',
};
setTimeout(function() {
$.ajax({
type: "post",
url: url,
data: data,
success: function(response) {}
});
}, delayInMilliseconds);
});
2
Answers
You need to use replace.
You have to try URL String like "/your_url" in ajax