javascript - Modifying the function from Bootstrap plugin typeahead.bundle.js without modifying actual js file -
I want to add some extra code to the function body, without actually modifying the file, the '_select' function. When I console the Typeahead object to see the hierarchy, I am unable to track the exact location of the '_select' function. In Chrome, the console shows the function under the 'node', I do not know what it is. So I would like to know how I can give a new definition of '_select' function.
My guess is that you can override with it:
typeahead.prototype._select = function () {console.log ("changed it");} Underscore indicates that selection is private and should not be directly or overridden . Selection in future releases - Something can be completely different or not at all, so your code will break.
Comments
Post a Comment