Index: misc/ajax.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/ajax.js,v
retrieving revision 1.10
diff -u -p -r1.10 ajax.js
--- misc/ajax.js	3 Feb 2010 08:23:12 -0000	1.10
+++ misc/ajax.js	15 Feb 2010 14:17:24 -0000
@@ -107,7 +107,7 @@ Drupal.ajax = function (base, element, e
 
   // Replacing 'nojs' with 'ajax' in the URL allows for an easy method to let
   // the server detect when it needs to degrade gracefully.
-  this.url = element_settings.url.replace(/nojs/g, 'ajax');
+  this.url = element_settings.url.replace(/\/nojs(\/|$)/g, '/ajax$1');
   this.wrapper = '#' + element_settings.wrapper;
 
   // If there isn't a form, jQuery.ajax() will be used instead, allowing us to
