This should be passed in either as an external JS setting, in Drupal.settings https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_add_js/7
 OR
since this is a template for a theme function you can either pass it in as a variable or use the global $base_url