locked
Uncaught SyntaxError: Invalid or unexpected token RRS feed

  • Question

  • User1979860870 posted

    Hi

      When i click on Delete i get above error

        $.ajax({
            url: "/Location/List",
            type: "GET",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            success: function (result) {
                var html = '';
                $.each(result, function (key, item) {
                    html += '<tr>';
                    html += '<td>' + item.Id + '</td>';
                    html += '<td>' + item.Description + '</td>';
                    html += '<td><a href="#" onclick="return getbyID(' + item.Id + ')">Edit</a> | <a href="#" onclick=Delete(' + item.Id + ')">Delete</a></td>';
                    html += '</tr>';
                });
                $('.tbody').html(html);
            },
            error: function (errormessage) {
                alert(item.Id);
                alert(errormessage.responseText);
            }
        });

    Thanks

    Saturday, May 15, 2021 3:59 PM

Answers

  • User287926715 posted

    Hi jagjit saini, 

    jagjit saini

    Uncaught SyntaxError: Invalid or unexpected token

    You can first check whether the imported JS is correct, and then you can also check whether an empty method body is executed.

    Or you can open F12 to view the specific location of the error, and then you can display it?

    Best Regards,

    ChaoDeng

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 17, 2021 2:21 AM