Hi there guys,
Take a look at the following code:
$( "#reorder" ).click( function(e) {
e.preventDefault();
$holder = $('#form1').serializeArray(); //gets everything from the form and puts it in associative array (holder)
$.ajax({
type: 'POST',
url: 'http://will.site88.net/jake/multimedia.php', //send array data to payment/check method confirm
data: $holder ,
success: function() {
location = 'http://will.site88.net/jake/multimedia.php';
console.log($holder)
}
});
});
#reorder is a submit button so I want to prevent the default action and then do the POST and reload with JS (This is because I want to use a modal confirm which I haven’t put in yet)
Anyway, it seems to be aborting the AJAX POST halfway through and jumping straight to the reload, I have inspected the network tab in various browsers and what I’m typically seeing is the POST appearing for a split second and then vanishing.
It works fine without JS, and I am testing for this with my php script. The script doesn’t even acknowledge receipt of the POST variable with JS switched on. Does anyone know what is happening??