Index: modules/comment/comment.js
===================================================================
RCS file: modules/comment/comment.js
diff -N modules/comment/comment.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/comment/comment.js	27 Jul 2010 18:41:46 -0000
@@ -0,0 +1,29 @@
+// $Id$
+(function ($) {
+
+/**
+ * Redirect to same page with additional 'comment' query parameter.
+ */
+Drupal.behaviors.commentPaging = {
+  attach: function (context) {
+    $('html', context).once('comment-paging', function () {
+      var cid = window.location.hash.match(/^#comment-(\d+)$/)[1];
+      // Only redirect if we have a URL fragment, but no 'comment' query
+      // parameter.
+      if (cid > 0 && !window.location.search.match('comment=')) {
+        // Append fragment to query parameters.
+        if (window.location.search) {
+          var newloc = window.location.href.replace(/(\?.*)(#)/, '$1&comment=' + cid + '#');
+        }
+        // Or add fragment as query parameter.
+        else {
+          var newloc = window.location.href.replace('#', '?comment=' + cid + '#');
+        }
+        // Redirect, without poluting history.
+        window.location.replace(newloc);
+      }
+    });
+  }
+};
+
+})(jQuery);
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.884
diff -u -p -r1.884 comment.module
--- modules/comment/comment.module	24 Jul 2010 17:48:16 -0000	1.884
+++ modules/comment/comment.module	27 Jul 2010 18:45:23 -0000
@@ -701,7 +701,7 @@ function comment_node_view($node, $view_
  * Build the comment-related elements for node detail pages.
  *
  * @param $node
- *  A node object.
+ *   A node object.
  */
 function comment_node_page_additions($node) {
   $additions = array();
@@ -716,7 +716,9 @@ function comment_node_page_additions($no
       $comments = comment_load_multiple($cids);
       comment_prepare_thread($comments);
       $build = comment_view_multiple($comments, $node);
-      $build['#attached']['css'][] = drupal_get_path('module', 'comment') . '/comment.css';
+      $path = drupal_get_path('module', 'comment');
+      $build['#attached']['css'][] = $path . '/comment.css';
+      $build['#attached']['js'][] = $path . '/comment.js';
       $build['pager']['#theme'] = 'pager';
       $additions['comments'] = $build;
     }
