A
A
Alexander2018-02-15 15:31:11
CSRF
Alexander, 2018-02-15 15:31:11

Periodically knocks out an error message with a status of 500, is this related to the csrf token?

When going to the employees page, so far only in Chrome (I have not met it in Opera so far), it periodically knocks out such a window:
5a85631309732064927310.png
with the following accompaniment:
5a856ceabe7ba771763319.png

routes :

Route::any('employees/sort', '[email protected]')->middleware('auth');
Auth::routes();
Route::get('logout', '\App\Http\Controllers\Auth\[email protected]');
Route::group(['middleware' => 'auth'], function() {
    Route::resource('employees','EmployeesController');
});

When going to the employees page, ajax loads the content.
function ajaxLoad(filename, content) {
    content = typeof content !== 'undefined' ? content : 'content';
    $('.loading').show();
    $.ajax({
        type: "GET",
        url: filename,
        contentType: false,
        success:function(data){
            console.log(data);
            $('#'+ content).html($(data));
            $('.loading').hide();
        },
        error: function (xhr, status, error) {
            alert(xhr.responseText);
        }
    });
}
$(document).ready(function () {
    ajaxLoad('employees/sort');
});


But this gives out periodically, when repeating the same actions, it may not happen, and then it appears again.
What can be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hopeful_romantic, 2018-02-15
@hopeful_romantic

Where do you include jQuery? in head?
https://tecadmin.net/referenceerror-is-not-defined...
and why are you using jQuery in the project and not Vue.js?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question