JQuery Ajax successfully returns data or error, syntax error, unexpected ‘= >’ (t_ DOUBLE_ ARROW)

Reason: Ajax accepts data types that are not the same as defined

 dataType: 'json',

Larvael returns data with one less comma

 $mes = array(
            'status' => "success",
            'message' => "added success"
        );

Correct code:


```php
 $mes = array(
            'status' => "success",
            'message' => "added success",
        );

Read More: