24
rated 0 times
[
25]
[
1]
/ answers: 1 / hits: 5441
/ 10 Years ago, tue, july 1, 2014, 12:00:00
I have the following code:
var result = confirm(You want to Subscribe to our Newsletter?);
var emailAddress = $(#subscribeEmail).val();
if (result == true) {
$.ajax({
type: 'POST',
url: '/php/subscribeNewsletter.php',
data: '{email: ' + emailAddress + '}',
complete: function(r){
alert(r.responseText);
}
});
}
I believe the problem is to do with:
data: '{email: ' + emailAddress + '}',
I am receiving an empty $_POST array on the server side of things.
More From » jquery