jQuery: How to call a jQuery plugin function on an element that hasn't yet been added to the DOM?
<p>I have a jQuery plugin that I am using:</p>

<pre><code>$(document).ready(function(){
    $('.elements').fancyPlugin();
});
</code></pre>

<p>This works great until I start adding new elements:</p>

<pre><code>$.get('ajax.html', function(data){
    $('#container').html(data);
});
</code></pre>

<p>I could call the plugin function again like this:</p>

<pre><code>$.get('ajax.html', function(data){
    $('#container').html(data).find('.elements').fancyPlugin();
});
</code></pre>

<p>...except that the AJAX is happening inside another jQuery plugin that shouldn't have to know about the <code>fancyPlugin()</code>.</p>

<p>How can I apply this plugin to all current and future elements?</p>
