JS ovewrite method of class
Hi all.
I have a class in a file js:
Code:
MyClass = function() {
this.myMethod = function() {
alert("Please.... override me");
}
this.otherMethod = function() {
alert("Please do not modify me");
}
}
on the same HTML file I want to import another JS file that overwrite some methods of MyClass (only some !!!!). How can I do that without doing a copy and past of the whole class ?
(I want to maintain the name MyClass as there are other JS files that I cannot modify that are using MyClass... )
Thanks !