Plugins 如何制作jquery插件

Plugins 如何制作jquery插件,plugins,jquery,rss,Plugins,Jquery,Rss,我正在尝试制作一个jquery插件 但它不起作用我做错了什么 (function($){ $.fn.rss({ //pass the options variable to the function rss: function(options) { //Set the default values, use comma to separate the settings, example: var defa

我正在尝试制作一个jquery插件 但它不起作用我做错了什么

(function($){
    $.fn.rss({ 

        //pass the options variable to the function
        rss: function(options) {
            //Set the default values, use comma to separate the settings, example:
            var defaults = {
                feedUrl: ''
            }

            var options =  $.extend(defaults, options);

            return this.each(function() {
                var Setting = options;
                //code to be inserted here

$.ajax({
    type: "GET",
    url: Setting.feedUrl,
    dataType: "xml",
    success: function(xml) {

        $(xml).find('channel').each(function(){
        $(xml).find('image').each(function(){
        var title2 = $(this).find('title').text();
        var url2   = $(this).find('link').text();
        $('<div class="title"></div>').html('<a href="'+url2+'">'+title2+'</a>').fadeIn(1000).appendTo('#title');
        });
        $(xml).find('item').each(function(){
        var title = $(this).find('title').text();
        var brief = $(this).find('description').text();
        var url  = $(this).find('link').text();
        $('<div class="items"></div>').html('<a href="'+url+'"><div class="dis">'+brief+'</div></a>').fadeIn(1000).appendTo('#blab');
        });
        });
    }
});
});
        }
    });

})(jQuery)
通过编写$.fn.rss…,您正在调用一个不存在的函数

您需要通过编写

$.fn.rss = function(...) { ... };

我现在要做的是如何让它盘旋