Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.735
diff -u -F^f -r1.735 common.inc
--- includes/common.inc	16 Dec 2007 14:09:24 -0000	1.735
+++ includes/common.inc	17 Dec 2007 18:29:31 -0000
@@ -1934,14 +1934,20 @@ function drupal_add_js($data = NULL, $ty
 
   if (isset($data)) {
 
-    // Add jquery.js and drupal.js the first time a Javascript file is added.
+    // Add jquery.js and drupal.js, as well as the base_path setting, the
+    // first time a Javascript file is added.
     if (empty($javascript)) {
       $javascript['header'] = array(
         'core' => array(
           'misc/jquery.js' => array('cache' => TRUE, 'defer' => FALSE, 'preprocess' => TRUE),
           'misc/drupal.js' => array('cache' => TRUE, 'defer' => FALSE, 'preprocess' => TRUE),
         ),
-        'module' => array(), 'theme' => array(), 'setting' => array(), 'inline' => array(),
+        'module' => array(),
+        'theme' => array(),
+        'setting' => array(
+          array('base_path' => base_path()),
+        ),
+        'inline' => array(),
       );
     }
 
Index: modules/system/system.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.js,v
retrieving revision 1.13
diff -u -F^f -r1.13 system.js
--- modules/system/system.js	27 Oct 2007 11:32:05 -0000	1.13
+++ modules/system/system.js	17 Dec 2007 18:29:33 -0000
@@ -42,7 +42,7 @@
  * are currently enabled.
  */
 Drupal.cleanURLsInstallCheck = function() {
-  var url = location.protocol +"//"+ location.host + location.pathname.replace(/\/[^\/]*$/, "/") +"admin/settings/clean-urls/check";
+  var url = location.protocol +"//"+ location.host + Drupal.settings.base_path +"admin/settings/clean-urls/check";
   $("#clean-url .description").append('<span><div id="testing">'+ Drupal.settings.cleanURL.testing +"</div></span>");
   $("#clean-url.install").css("display", "block");
   $.ajax({
@@ -85,7 +85,7 @@
       sourceField.addClass('copy-field-values-processed');
     }
   }
-}
+};
 
 /**
  * Show/hide custom format sections on the date-time settings page.
