Hello, i made this ajax call to approve some lines on my page:
//calling ajax on click
<button type="submit" class="btn btn-default btn-sm" id="approveLine" onclick="approveLine('.$row['id'].')"> approve</button>
function approveLine(val) {
event.preventDefault();
$.ajax({
global: false,
type: 'GET',
url: '/action.php?action=approveLine&id='+val+'',
success: function (result) {
console.log(result);
$('#contenthere').load('/receipt.php?view=edit&id=<?=$id;?>&res=approved');
},
error: function (request, status, error) {
serviceError();
}
});
}
It worked all good on Chrome, IE and Edge until i tried it on mozilla
it returned error : ReferenceError: event is not defined
How can i fix that?
Thanks for comments!