I am trying to override one function by replacing it with a different version. The function which I am trying to override is defined in a web resource of a control. But, I have tried the same for script resources, it works.
function HookCalendarFunction() {
try {
var Original_performLayout = _performLayout;
_performLayout = function () {
performLayout();
};
var Original_cell_onclick = _cell_onclick;
_cell_onclick = function (val) {
cellClick(val);
};
}
catch (e) {
}
}
Here, _performLayout is a function for a custom control in ASP.net. _performLayout is in web res开发者_运维知识库ources of the control.
Thanks Ashwani
Check _performLayout is global and your that declaration happens after the original declaration.
I solved the issue, the issue was with the scope of function.
精彩评论