how to update a node field value with jQuery callback the drupal way? added the callback for jQuery to the hook_menu in my module.

// callback for jQuery with nid and new status as arguments
$items['vacancies_manage/status_callback/%/%'] = array(
    'page callback' =&gt; '_vacancies_manage_status_update_callback',
    'page arguments' =&gt; array(1,2), 
    'access callback' =&gt; array('manage own vacancies'),
    'type' =&gt; MENU_CALLBACK,
);

return $items;


but how do I call this callback from the module using jQuery instead of just the link? Is there a drupal way for this?
The jQuery would be pretty simple, something like this:

$('#link-id').click(function() {
  $.ajax({
    url: '/vacancies_manage/status_callback/' + id1 + '/' + 'id2', 
    data: {'arg1': 1, 'arg2': 2}, 
    success : function(data) {
      alert(data);
    }
  });
});


You'll need to replace id1 and id2 with the arguments appropriate to your situation, and arg1 and arg2 with whatever you want your POST vars to contain.

Then you just need to make sure that you callback actually prints directly to the page, and doesn't return the entire rendered Drupal page so that the jQuery code can receive a response:

function _vacancies_manage_status_update_callback() {
  // Do something with $_POST vars here

  // Print something, perhaps a status message to be picked up in jQuery
  print 'OK';
  drupal_exit();
}