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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -