AJAX request failing each time I try to invoke php function from module I'm trying to invoke a AJAX request whenever someone clicks a download button on my drupal site. 

In my module I have referenced the javascript file in the (my-module).info as follows:

scripts[] = js/my_module.js


my_module.js:

(function ($) {
  $(document).ready(function(){
    $(".book-purchase-button").click(
    function(){
        $.ajax({
        type: 'POST',
        url: '/foo/ajax/tag',
      success: function(){
        alert("AJAX Call Successful!");
    },
      error: function(){
        alert("AJAX Call Failed!!");
    }
        });
    });  
  });
})(jQuery);


I figured I could do a menu callback to capture the AJAX request based on the url

my_module.module:

/*
*    Implements hook_menu().
*/
function my_module_menu()
{
  $items = array();
  $items['/foo/ajax/tag'] = array(
    'title' =&gt; '',
    'page callback' =&gt; 'my_module_tag_user',
    'access arguments' =&gt; array('access content'),
    'access callback' =&gt; TRUE, // allows access to any user
    'type' =&gt; MENU_CALLBACK,
  );
  return $items;
}


But for some reason the AJAX request keeps alerting me that the ajax call has failed... Is there something I'm doing wrong?
Routes don't have leading slashes:

$items['foo/ajax/tag'] = array(


Clear caches, and assuming the callback function exists and writes something to the buffer, it'll start working.