Hi there,
I know this sounds pretty trivial, but I'm new to jQuery... I use this plugin: http://www.emposha.com/javascript/fcbkcomplete.html
Its source code contains:
jQuery(function ($) { $.fn.fcbkcomplete = function (opt) { return this.each(function () { /// ... /// ...implementation deleted... /// ... // public method to add new item this.addItem = function (title, value) { addItem(title, value); } return this; }); }; });
I know how to use this element in my code and it works fine:
$(document).ready(function() { $("#select2").fcbkcomplete({ ... options deleted ... }); });
Now I want to call public method addItem() on the instance of the object "fcbkcomplete" created in my code (for example, when I click a button or from onTimer event). But I don't know how to access it. I tried to do it this way, but it does not work:
var fcel = $("#select2").fcbkcomplete({ ... options deleted ... }); fcel.addItem('Test1', 'Test1');
Firefox shows error: "fcel.addItem is not a function".
Thanx...