When I click button I have above JSON error. It doesn't return any values. can you please help me to solve this,
Here my Jquery code,
$(document).ready(function(){
$('.package_details').click(function(){
$('.txt-form').slideDown("slow");
var package = $(this).attr("id");
$.ajax({
type:"post",
url:"aaa.php",
dataType: 'json',
data:"pack="+pack,
success:function(html){
$('.package_name').val(html.package_name);
$('.package_price').val(html.package_price);
$('.discount_percentage').val(html.discount);
$('.amount_after_discount').val(html.amnt_discount);
$('.tax_percentage').val(html.tax);
$('.amount_after_tax').val(html.amnt_tax);
if(html.package_type == 'Contact Visible'){
$('.contact').attr('checked', 'checked');
}else if(html.package_type == 'Job post'){
$('.job').attr('checked', 'checked');
}else if(html.package_type == 'Both'){
$('.both').attr('checked', 'checked');
}
$('.contact_visible').val(html.count);
$('.job_post').val(html.job_post);
$('.valitity_day').val(html.valitity);
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Not done - ' + textStatus + ' ' + errorThrown);
}
})
})
})
And Here my PHP code,
echo json_encode(array("package_name"=>$package_name,"package_type"=>$package_type,"discount"=>$discount,"amnt_discount"=>$amnt_discount,"tax"=>$tax,"amnt_tax"=>$amnt_tax,"count"=>$count,"job_post"=>$job_post,"package_price"=>$package_price,"valitity"=>$valitity));