I have a jQuery function as follows:
(function ($) {
$.fn.autoSuggest = function (data, options) {
function add_selected_item(data, num) {
(function ($) {
$.fn.autoSuggest = function (data, options) {
alert(data);
}
})(jQuery);
}
}
})(jQuery);
If I wanted to call the local add_selected_item() function from outside this function, how would I do it?
I've tried doing:
$.autoSuggest.add_selected_item(data, opt);
But am getting an $.autoSuggest is undefined.
Still learning the ropes with jQuery. I am not sure exactly how this can be accomplished, if at all.
Thanks!
Try this :
$.extend({
autoSuggest: function(){
...
}
});
or
$.fn.autoSuggest = function(){
...
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With