[SOLVED] JQuery - AJAX 500 Internal Server Error - JSON - jQueryAjax



The above error always occur if you work with jQuery + Ajax.

The error above may have several reason why the error occur and one of the reason is you are using the different parameter name to post to the server. Let say the method getState in webservice require one parameter which will represent country name, you must use the exactly name parameter to request from webservice.



The Other Reason

  1. Not using JSON.stringify to pass parameter value.
  2. If you not supply type in jQuery, it will use GET method which is not accept in your webservice configuration. Add  ( type : "POST ) in your jQuery code to use POST method.
  3. You are actually request data from different domain. Cross Domain Request (CORS)which is not allowed. Please read here
  4. Content type not supply or not correct. Use "application/json; charset=utf-8"
  5. DataType not not supply or not correct. Use json or jsonp

By
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

Popular posts from this blog

Example to disable save as certain file type in SSRS Report Viewer

How to create DataGrid or GridView in JSP - Servlet

Control Webpart Visible/Enable using macro in Kentico