Not getting into the callback when calling my jquery plugin
<p>I created a jquery plugin which inserts the element <code>#tweetFeed</code>, along with some other things. When I call my plugin, and then try to insert an element into <code>#tweetFeed</code> in the callback, it doesn't insert it. Any ideas why?</p>

<p>Here's the code that is calling the plugin:</p>

<pre><code>$(document).ready(function() {

    // add the sidebar plugin
    $('html').social(function() {

        //doesn't print anything...ARGGG!!
        console.log('#tweetFeed = '+ $('#tweetFeed').parent().html());
        //$('#tweetFeed').append("&lt;p&gt;TEST&lt;/p&gt;");
        //alert("test alert");  // this works now!

        //this line does NOT work. Why?
        $('#tweetFeed').append('&lt;script src="http://widgets.twimg.com/j/2/widget.js"&gt;&lt;/script&gt;&lt;script&gt;new TWTR.Widget({version: 2,type: \'profile\',rpp: 4,interval: 6000,width: 250,height: 280,theme: {shell: {background: \'#333333\',color: \'#ffffff\'},tweets: {background: \'#ffffff\',color: \'#444444\',links: \'#e02046\'}},features: {scrollbar: false,loop: false,live: false,hashtags: true,timestamp: true,avatars: false,behavior: \'all\'}}).render().setUser(\'CSuitesIndepend\').start();&lt;/script&gt;'); 
    }); 

});
</code></pre>

<p>You can see a live example of my problem <a href="http://social.allthingswebdesign.com" rel="nofollow">here</a></p>

<p><strong>EDIT:</strong> After adding @Nicos suggestion, my plugin looks like this:</p>

<pre><code>(function($) {
    $.fn.social = function(callback) {

        var defaults = {

        };
        var options = null;
        var settings = $.extend({}, defaults, options); 

        // stuff goes on here


        if(typeof callback == 'function'){
            callback.call(this);
        }
        return this;
    }
})(jQuery)
</code></pre>

<p>The only problem is when I try to append my twitter js code, I get errors which you can see <a href="http://social.allthingswebdesign.com" rel="nofollow">here</a> . What is causing these errors? The alert works just fine.</p>
