1
Next, I have a form that will be sent with AJAX, but the URL will vary according to the ID, example:
site.com/ajax/remove/100 <- ID
site.com/ajax/remove/200 <- ID
This ID value is in an Hidden field of the form, how can I take this value and pass to ajax? example of the code:
jQuery(document).ready(function() {
jQuery('#send_request').submit(function() {
var dados = jQuery(this).serialize();
//var id =
jQuery.ajax({
url : 'site.com/'+id,
dataType : 'JSON',
type : "POST",
data : dados,
success : function(response) {
//alert(response.message);
if (response.success == 1) {
//tudo ok
} else {
//deu ruim,zé
}
}
});
return false;
});
});