I'm real new to jquery plugins. I want to create a function plugin which have a parameter function that return something to user just like what $.get works.
These are my codes I have tried out

```
(function($) {

    $.fn.myfunc = function(options) {
        if (typeof options === 'undefined') {
            options = {};
        }
        return this;
    };

    $.myfunc = function(options, e) {
        // Default options

        var settings = $.extend({}, $.myfunc.options, {
            anotherfunc: function(a) {
                //
            }
        }, options);
    };

    /**
     * Globally definable rules
     */
    $.myfunc.options = {
        param1: "",
        param2: '',
    }
})(jQuery);

```

I want to achieve this after calling my plugin

```
test = function() {
     $.myfunc({
         param1: "my first param",
         param2: 'my second one',
         anotherfunc: function(data) {
             alert(data); //return something from my plugin
         }
     });
};
$(document).ready(test);

```

I have google and regoogle for hours now . Any help please.