I'm trying to execute some JS right before my Paypal button is clicked, like this:
$('#paypal-button-container form').submit(function(){
beforePaypalSubmit();
});
The contents of beforePaypalSubmit() are:
function beforePaypalSubmit()
{
$.ajax({
type: 'GET'
, url: urls.beforePaypalSubmit
, data: {
id: state.id
}
, async: true
});
}
This simple ajax call should result in a database row being inserted but it isn't. I get 0 PHP error in the logs. Actually, the url doesn't even gets called (checked in the access log). If I do a simple alert() instead of beforePaypalSubmit(), it gets called. What am I missing?