How to use user_load() for user on $_GET[] request in Drupal way?
As said in the comment for the question, you should use placeholders in your menu definition.

function hover_card_menu() {
  $items['hover-card/%user'] = array(
    'title' =&gt; 'Hover Card',
    'page callback' =&gt; 'hover_card',
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_CALLBACK,
  );

  return $items;
}


Then you can pass the user ID for the currently logged-in user to the JavaScript code, instead of passed the module path, which is irrelevant.

function hover_card_init() {
  $module_path = drupal_get_path('module', 'hover_card');
  drupal_add_js($module_path . '/javascripts/hover_card.js');
  drupal_add_js(array('hover_card' =&gt; array('user_id' =&gt; $GLOBALS['user']-&gt;uid)), array('type' =&gt; 'setting', 'scope' =&gt; JS_DEFAULT));
}


The JavaScript code doesn't need to know the module path, since it will make an AJAX call to hover-card/%user which is not related to the module path in any way.