I am using a plugin JS and need to call a function in it.
It is having functions inside a variable like,
var win = window;
var Page = function(pageOptions, callback) {
function abc(){
--------
}
function xyz(){
------
}
};
win.Sales = {
Page: Page
};
Now, I need to call a function abc(). How can I call it.
Already tried with win.Sales.page.abc();.
Please help me out on this. Thanks in advance.
You cant call function
abcsince it is declared as a private member of the function referenced by variablePage.If you want to call the function You have to make it as a property of the variable
Page.But there is another problem of variable scoping like if there is another variable x defined in function
Pageand used inside functionabc, it will not work.Anyway since you’ve said it is a js plugin I do not think it will be possible for you to change the function
Page. So the answer will be No you cannot do that.