I am loading up a framework (Microsoft AJAX Framework) along with Prototype and an autocomplete textbox. Both the framework and the autocomplete are adding behavior to some textboxes. I usually want both snippets to run, but not at all times. Basically, if an autocomplete item has been selected, I dont want the framework JS to run.
I thought I would try to overwrite the framework using a technique like this: Overriding a JavaScript function while referencing the original.
var original_doSomething = doSomething;
doSomething = function()
{
//do something *else*
if(something) original_doSomething();
}
However, the framework is a little clever and has been proving difficult to overwrite event handler is retaining the original function. I wrote a jsfiddle to mock the situation. http://jsfiddle.net/jeffrod/haHD4/2/
Is there anyway to overwrite dosomething
so I can add my own logic to it??