I need to convert a string called edos.desktop to a variable containing a main function, it needs to be like this:
edos.desktop = {
main: function() {
. . .
},
};
and I need to call the function like this:
var package = "edos.desktop";
. . .
package.main();
but how?
I tried to use the window[package].main(); and this doesn't work!
I tested:
alert(window[package]);
and it shows undefined, and:
alert(window[package].main());
does not show the alert...
please help me!!!
...and I dont want APIs
"edos.desktop"is input?edos.desktop = { main: function() { . . . }, }is expected output? How ispackage.main()related to input and output?packagepackage = "edos.desktop";