may this title of this question is duplicated , but I can't Google to find what I need. For exam I have an js file created before, in this file I defined a function
function fun1()
{
alert("a");
}
So I call this function in some "click" trigger
$("button").click(function(e){
fun1();
})
Now, I added new module and I don't want to change the define of function 1, I want to extend function 1 like this
function fun1ex()
{
alert("b");
}
it mean that, when "button" clicked, 2 alert boxs will be shown ("a") and ("b") May I use class and prototype? But I can't image how to do it. Thanks
fun1()insidefun1ex()? Or have the click event call both functions? Keep it simple, stop trying to over-complicate it with class and prototype.