If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Ok, I tested modifying the object, instead of the class. In other words, create your class, then define the object by declaring, var myObject = new Class(); Once the object has been created, THEN can you modify it's methods. However, you cannot modify methods of the browser's existing objects and classes, such as the document object or the Element class. Anyway, here's how I do it:

Thanks jamesbcox1980 , but it still doesn't do what I need... I need to overwrite a CLASS method... so that all the other JS that use obj = new MYCLASS() will work with my new class... I do not have controll on the other JS that uses the MYCLASS

But you can't do that. You can't modify a class without redefining the entire thing. And even that is a violation of strict code practices... I thought JS might be different, since I haven't played a lot with classes in JS, but that's not the case.

Honestly, this is a hack way of doing things, and you might rethink your methods.