F
foldface
Hi
I have 2 frames on a web page, both frames hold webpages that start
with
http://localhost/ (hence avoiding cross scripting errors)
I want one frame to control the other, to load up the web pages,
press
buttons etc.
I've got this working by using the below (snippet enclosed). When a
page
is loaded, SetPageLoadValue is called
My question is why does it only work with the variant shown, why don't
the commented out lines have the same effect?
I don't know the dom that well so I've tried inserting the word
'document'
into the MainFrame/MainDocument functions in different places to no
avail
Thanks
F
function Go()
{
//MainFrame().attachEvent('onload',SetPageLoadValue);
//MainFrame().onload = function(){SetPageLoadValue()}
//MainDocument().attachEvent('onload',SetPageLoadValue);
//MainDocument().onload = function(){SetPageLoadValue()}
parent.document.getElementsByTagName('frame')['Main'].attachEvent('onload',
SetPageLoadValue);
}
function MainDocument()
{
return parent.frames['Main'].document;
}
function MainFrame()
{
return parent.frames['Main'];
}
I have 2 frames on a web page, both frames hold webpages that start
with
http://localhost/ (hence avoiding cross scripting errors)
I want one frame to control the other, to load up the web pages,
press
buttons etc.
I've got this working by using the below (snippet enclosed). When a
page
is loaded, SetPageLoadValue is called
My question is why does it only work with the variant shown, why don't
the commented out lines have the same effect?
I don't know the dom that well so I've tried inserting the word
'document'
into the MainFrame/MainDocument functions in different places to no
avail
Thanks
F
function Go()
{
//MainFrame().attachEvent('onload',SetPageLoadValue);
//MainFrame().onload = function(){SetPageLoadValue()}
//MainDocument().attachEvent('onload',SetPageLoadValue);
//MainDocument().onload = function(){SetPageLoadValue()}
parent.document.getElementsByTagName('frame')['Main'].attachEvent('onload',
SetPageLoadValue);
}
function MainDocument()
{
return parent.frames['Main'].document;
}
function MainFrame()
{
return parent.frames['Main'];
}