I have a function onChangeBrand() in A.js and there is a same name in B.js.
So how to avoid this situation? There is a constraint – I can’t change the function names.
and i am not allowed to edit both the Js files so namespace is not a right idea for me.
Can we call something like A.onChangeBrand() or B.onChangeBrand()?
Ok, if namespaces are not for you and you can put your code in between the
scripttags loading these filesafter that
a_onChangeBrand()will call the function from a.js and onChangeBrand() from b.jsBut nothing will help you if some functions in those a.js and b.js are also using these functions – they might call function from the last file loaded.