Bonjour,
J'ai essayé de tester mon code afin d'utiliser ajax,mais je n'ai reçu aucun retour(rien n'a changé)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| $('.attachment').click(function (e){
var data = {};
data['date'] = $('.date').val();
$.ajax({
url: "{{path('data_connect_log_attachment')}}",
type: 'post',
data: data,
dataType: "json",
success: function (data) {
console.log( "hello!" );
$('.attachment').hide();
}//end succes
,
error: function (xhr, ajaxOptions, thrownError) {
}
}); //end ajax
}); |
<a download="telcharger" target="_blanc" href="https://mon_url/attachments/{{attachment.public_key}}" class="attachment">{{attachment.name}}
Est ce que quelqu'un peut m'aider mon probléme est du à quoi?comment pourrai je faire fonctionner ajax?
Partager