0

I am working on some plugin of java script. I am using that plugin in my Project. Now there is needed some changes so i am changing that original js file and using that file. Now issue is when there is any update came, my changes has overridden or removed by that update. I am looking for how to override the original function from the original js file into new(mine) js file and how can i get updated version and can customize that file also? please help.

1 Answer 1

1

In Javascript its possible to override nearly everything (not the prefered way, but possible)

So, if the orginal function is located on

window.app.function1

you could just do this:

window.app.function1 = function() {
 // your code
}

This way is also called "monkey patching"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.