Simple question here. I want to send two strings as data in an ajax request. Problem is in this ajax request it only sends the second sting of data and not the first. How would I send both of those in one ajax request?
$.ajax({ url: '#{add_cards_path}',
type: 'POST',
beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', '#{form_authenticity_token}')},
dataType: "json",
data: 'credit_uri=' + response.data.uri,
data: 'address=' + $('.address').val(),
success: function(response) {
window.location.assign(location.protocol + '//' + location.host);
}
});
I want to send "credit_uri" and "address". How?