I have been working on some old jsp pages, and am trying to introduce jQuery to it. However, this is what I get when I start using jQuery on the page:
base.js:249 Uncaught TypeError: f is not a function
So obviously there is a conflict between our legacy base.js and jQuery. And here's the code snippet from base.js that caused the issue:
Object.prototype.each = function (f) {
for (var n = 0; n < this.length; n++) {
f (this[n],n); // This is line 249
}
return this;
};
The bad news is that I can't easily refactor this library out of the page because there are a few other JavaScript libraries using it for the page.
Is there anything I can do? Thanks!