The success function does not give results. How do I solve this?
I have the following code
function fun()
{
var list_target_id = 'year';
$.ajax({
url: '://localhost/htdocs/cscart_mutli_car/index.php?dispatch=drill.drill',
dataType: 'json',
success: function (data) {
alert(data);
},
error: function (xhr, status, error) {
alert(xhr.responseText);
}
});
}
if ($mode == 'drill')
{
$id = 166;
$arr = array('category_id' = > 167, 'category' = > 'computers');
echojson_encode($arr);
exit;
}
Here in this Ajax I get the success alert. But it does not provide any results. How do I solve this?