I’ve read your link,I understood AJAX is for getting data from sever without refreshing the page,also WP does this by admin-ajax.php
in your example data sent to server is
var data = {
action: ‘my_action’,
whatever: 1234
};
this function: my_action_callback returns $_POST[‘whatever’] increased with 10
I don’t know how to put this in my case : how to call server from the download menu using ajax in order to call my function and also to download the file
??
thanks.