Saturday, 31 August 2013

How to make array data in custom jQuery Function?

How to make array data in custom jQuery Function?

I'm looking for some tutorial to make an array data in custom jQuery
Function, but I can't find any. Can you tell me how to make an array in
jQuery Function? I want to call my function like this :
$(this).myPlugin({
data_first: '1'
data_second: 'Hello'
});
my function script
(function($) {
$.fn.myPlugin = function(data) {
return this.each(function() {
alert(data[data_first]+' bla bla '+ data[data_second]);
});
}
})(jQuery);

No comments:

Post a Comment