I’m tyring to find out how some website works. In it’s JS codes there is a ‘Commander’ object that is used many times in scripts within webpages:
parent.Commander.SetTime();
parent.Commander.GetData();
etc...
and they work, i know because the SetTime() already sets the time for the pages i view within the website and other methods also are doing their jobs.
but when i try to access the Commander object i can’t.(parent.Commander returns ‘undefined’ when i try to access it in debug console)
Plus, i can’t find where ‘Commander’ is defined.
The webpage looks like this:
There is a frameset, and one of it’s frames’ name is ‘Commander’.
...
<FRAME noResize src="/_Templates/Commander.htm" name=Commander scrolling=no>
...
‘Commander.htm’ loads ‘Commander.js’.
...
<SCRIPT language=javascript src="/_Scripts/Commander.js"></SCRIPT>
...
‘Commander.js’ consist of function definitions
function SetTime(){
...
}
...
but the commander object is not defined anywhere. i’m expecting something like this:
function Commander()
{
SetTime()
...
}
OR
Commander = new Object();
Commander.SetTime=function();
so i want to know how i can access Commander’s methods.
(if my question is unclear, please ask me to explain more. thank you)
parent.Commanderrefers to the frame’s content window, soparent.Commander.SetTime()would bsically be referring to the global functionSetTime()defined within theCommanderframe.