Is it possible to call a nested function with just a string? For example:
function oot(wha) {
function inn(wha)
{
First.innerHTML+="Inner ["+wha+"]";
}
oot.inn = inn;
Second.innerHTML+="Outer ["+wha+"]";
}
oot("1");
oot.inn("2"); //works okay
window["oot"]("3"); //works okay
window["oot.inn"]("4"); //<The problem, doesn't work.
window["oot"]["inn"]("4"); //Works, thanks.
I have made some edits to improve code readability and provide a solution. If there is no straightforward way to achieve this with a single string input, I will wait for a few hours before marking the question as unanswered in case there is another solution.