Refactor jQuery Ajax listener to use .on() instead of .live()
<p><strong>Edit</strong> This is a recently upgraded Rails 4 app. </p>

<p>I'm trying to refactor this ajax event listener to use .on() instead of .live(). The first two code blocks have been refactored and the last block of code being the place where I'm stuck. From what I've read it was wrong to begin with, but functioned nevertheless.</p>

<p>How do I refactor this so that it's a global listener for a specific ajax:success event?</p>

<p>This is the code that submits the form and triggers the ajax event.</p>

<p><strong>Edit</strong> Forgot to mention that form is remote. </p>

<pre><code>jQuery(document).on('click', '.form_submitter', function () {
        if ((forms = $(this).parents('form')).size != 0) {
            var form = forms[0];

            if (jQuery(form).attr('data-remote')) {
                jQuery(form).trigger('submit');
            } else {
                forms[0].submit();
            }
        }
        return false;
    });
</code></pre>

<p>This is the code which creates the custom event upon success of a submitting a specific form.</p>

<pre><code>jQuery(document).on('ajax:success','form.my_form', function (event, data) {
    // Fire a custom event
    jQuery(this).trigger('custom_event', data);
});
</code></pre>

<p>This is the block of code which listens for the custom event and does stuff. It <strong>has not</strong> been refactored.</p>

<pre><code>jQuery('*').live('custom_event', function(event, data) {
    // Do stuff
)};
</code></pre>

<p>It's my understanding that .on() needs a selector in the trailing parens, but <code>'*'</code> isn't a suitable selector. Is there a way around this?</p>