<t>jQuery.ajax attempts to convert the response body based on the specified dataType parameter or the Content-Type header sent by the server. If the conversion fails (e.g. if the JSON/XML is invalid), the error callback is fired.<br/>
<br/>
Your AJAX code contains:<br/>
<br/>
dataType: "json"<br/>
<br/>
```<br/>
<br/>
In this case jQuery:<br/>
<br/>
Evaluates the response as JSON and returns a JavaScript object. […]<br/>
The JSON data is parsed in a strict manner; any malformed JSON is<br/>
rejected and a parse error is thrown. […] an empty response is also<br/>
rejected; the server should return a response of null or {} instead.<br/>
<br/>
Your server-side code returns HTML snippet with `200 OK` status. jQuery was expecting valid JSON and therefore fires the error callback complaining about `parseerror`.<br/>
<br/>
The solution is to remove the `dataType` parameter from your jQuery code and make the server-side code return:<br/>
<br/>
```<br/>
Content-Type: application/javascript<br/>
<br/>
alert("Record Deleted");<br/>
<br/>
```<br/>
<br/>
But I would rather suggest returning a JSON response and display the message inside the success callback:<br/>
<br/>
```<br/>
Content-Type: application/json<br/>
<br/>
{"message": "Record deleted"}<br/>
<br/>
```</t>