Click here to Skip to main content
14,575,978 members
Rate this:
Please Sign up or sign in to vote.
data table when filled with json, jquery and webserice run fine on local machine but when publish on server it is giving Failed to load resource: the server responded with a status of 500 (Internal Server Error)


What I have tried:

$.ajax({
            url: "testing.asmx/Get_DashBoardData",
            type: "post",
            dataType: "json",
            success: function (data) {
                $('#MO').dataTable({
                    data: data,
                    "bInfo": false, //Dont display info e.g. "Showing 1 to 4 of 4 entries"
                    "paging": false,//Dont want paging                
                    "bPaginate": false,//Dont want paging   
                    "bFilter": false, //hide Search bar
                    columns: [
                        { 'data': 'abc' },
                        { 'data': 'cde' },
                    ]
                });
            },
            error: function (request, status, error) {
                alert(request.responseText);
            }
        });
Posted
Comments
MadMyche 1-Jun-20 14:07pm
   
The actual exception would be very helpful
Khan Sameer 1-Jun-20 14:22pm
   
When i check inspecting the page in the Network tab the function Get_DashBoardData is shown in red color with
Name : Get_DashBoardData
Status : 500
Type : xhr
Initiator : jquery.min.js
MadMyche 1-Jun-20 17:40pm
   
The actual exception on the server is what I was looking for
Khan Sameer 2-Jun-20 1:10am
   
Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the
arguments objects for calls to them at Function.invokeGetter (<anonymous>:1:142)]

Internal Server Error
jquery.min.js:2 [Violation] 'load' handler took 21304ms
jquery.min.js:2 [Violation] 'setTimeout' handler took 5863ms
Richard Deeming 2-Jun-20 6:11am
   
You're still looking at the Javascript error. You need to inspect the network request and look at the response to see if the server-side error details are returned. If they're not, then you'll have to check the application event log on the server to find out what the problem is.
ZurdoDev 2-Jun-20 7:20am
   
Usually that is hyperlinked and if you click it, it will open the request in a new tab and hopefully show the full error, depending on how you're setup.
F-ES Sitecore 2-Jun-20 8:07am
   
The 500 status means the server function is failing. If the code works ok locally then it's unlikely to be the client code you've posted, there is something about your server code that isn't working on the deployed machine, and that could be anything. As already advised, you need to find the actual server error being thrown by looking at the response to your network request or other means.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100