When I was integrating datatables in my web pages, I had and issue of viewing result or error.When an error occurs, it always gives a screen as below.



But this error does not have details regarding the issue. In console also it does give the error in detail. In console it always says "Internal  Server Error".

Therefore we have to find a way to debug the code.Sometimes we have to print sql query and see where we have done the issue. 

Therefore I am going to explain you how to debug code in datatables.

Add Below lines into datatables script


That's all :-)