Index: flag.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag/Attic/flag.module,v
retrieving revision 1.11.2.54
diff -u -F^[^a-z]*function -r1.11.2.54 flag.module
--- flag.module	19 Nov 2008 19:41:38 -0000	1.11.2.54
+++ flag.module	24 Nov 2008 10:35:00 -0000
@@ -791,6 +791,11 @@ function flag_page($action, $flag_name, 
     print drupal_to_js(array(
       'status' => TRUE,
       'newLink' => $flag->theme($flag->is_flagged($content_id) ? 'unflag' : 'flag', $content_id, TRUE),
+      // Further information for the benefit of flagSuccess event handlers:
+      'contentId' => $content_id,
+      'contentType' => $flag->content_type,
+      'flagName' => $flag_name,
+      'flagStatus' => $flag->is_flagged($content_id) ? 'flagged' : 'unflagged',
     ));
     exit;
   }
Index: theme/flag.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag/theme/Attic/flag.js,v
retrieving revision 1.1.2.5
diff -u -F^[^a-z]*function -r1.1.2.5 flag.js
--- theme/flag.js	14 Nov 2008 16:55:45 -0000	1.1.2.5
+++ theme/flag.js	24 Nov 2008 10:35:00 -0000
@@ -15,7 +15,7 @@
    * @param element
    *   The <A> element.
    * @return
-   *   The new <A> elemenet.
+   *   The new link.
    */
   function updateLink(element, newHtml) {
     var $newLink = $(newHtml);
@@ -38,12 +38,12 @@   function updateLink(element, newHtml) 
     // Replace the old link with the new one.
     $wrapper.after($newLink).remove();
 
-    // So it won't crash on Drupal 5.
-    if (Drupal.attachBehaviors) {
+    if (Drupal.attachBehaviors) { // So it won't crash on Drupal 5.
       Drupal.attachBehaviors($newLink.get(0));
     }
 
     $('.flag-message', $newLink).fadeIn();
+    return $newLink.get(0);
   }
   
   /**
@@ -76,7 +76,8 @@   function flagClick() {
       success: function (data) {
         if (data.status) {
           // Success.
-          updateLink(element, data.newLink);
+          data.link = updateLink(element, data.newLink);
+          $.event.trigger('flagSuccess', [data]);
         }
         else {
           // Failure.
