pass data parameters to ajax call
<script>
$.ajax({
url: "discount.php?e="+<?php echo intval($_POST["id"]);?>+"&c="+code,
success: function(data){
if(data.indexOf('%') === -1) { // if % is not found on discount ticket
console.log("non percentage discount") ;
discount = parseInt(data);
if (discount>0)
discount = 0-discount;
$('#discount_amount').val(discount);
}
}
</script>