Programmers learn & share
0 votes
27 views

Problem :

I want to send a call using ajax but in Chrome getting following error

“Failed to load resource: the server responded with a status of 500 (internal server error)”

But for firefox getting no error. I also tried to record the ajax call in firebug but there is no call request in firebug May I know the solution for this issue?.

Index.chshtml code is as follows

function onLoad(e) {

    var grid = $(this).data("tGrid");

    //bind to the context menu of the Grid's header

    event.preventDefault();

    $(this).find(".t-grid-header").bind('contextmenu', function (e) {

        //wait for the menu to be generated

        setTimeout(function () {

            // bind to the checkboxes change event. The context menu has ID in the format "GridName" + "_contextmenu"

            $('#globalsearchgrid_contextMenu :checkbox').change(function () {

                debugger;

                var $checkbox = $(this);

                // the checked state will determine if the column has been shown or hidden

                var checked = $(this).is(":checked");

                // get the index and the corresponding column from the Grid's column collection

                var columnIndex = $(this).data("field");

                var request = "{'columnIndex':'" + columnIndex + "'value':'" + checked + "'}";

                $.ajax({

                    type: "POST",

                    url: "../../GlobalSearch/SaveColumnInfo",

                    data: request,

                    contentType: "application/json; charset=utf-8",

                    dataType: "json",

                    success: function (msg) { },

                    error: function (xhr, status, error) {

                        alert(error.responseTextss);

                    }

                });

            });

        });

    });

}

by (6.9k points)   | 27 views

1 Answer

0 votes

Solution :

The 500 error code normally indicates that there is an error on the server, and there is nothing wrong with your code.

·         Please speak with the server development team to get more information on it.

·         Try to verify your argument values into the call. Also search for anything that you think can cause a problem to the server process. Ideally the process should not terminate and should return you a better response code.

·         May be intermittent like if the server database is down. You can try after some time.

by (36.1k points)  
2,245 questions
2,807 answers
60 comments
241 users