enginkizil / FeedEk

FeedEk jQuery RSS/ATOM Feed Plugin
https://jquery-plugins.net/FeedEk/FeedEk.html
MIT License
207 stars 107 forks source link

On sucess callback with arguments #30

Open ychaouche opened 10 years ago

ychaouche commented 10 years ago

Small change to allow caller to pass on a callback function and its arguments that would be called whenever retreival of feed is done:

From caller's perspective :

function callback(args){
   [...]
}

$("#myid").FeedEk({
FeedUrl       : url      ,
MaxCount      : 20       ,
ShowDesc      : false    ,
ShowPubDate   : false    ,
[...]
/* New options */
Callback      : callback ,
Callback_args : {...}    ,
});

Changes made to Feedk.js' success property :

        success: function (data) {
        ...
            if (def.Callback) {
                def.Callback(def.Callback_args);
            }
        }
    });
};
})(jQuery);