Drupal.settings.basePath is not giving the base_url in js
You need to pass it manually like this.

global $base_url;
drupal_add_js(array('baseUrl' =&gt; $base_url), 'setting');


Then call like this Drupal.settings.baseUrl.

Drupal.settings.basePath value is coming from base_path() api. See this documentation about base_path.