|
Posted by Jonathan N. Little on February 1, 2008, 12:19 pm
Please log in for more thread options BerlinBrown wrote:
>>
>>
>>
>>> We have a complicated setup; where we have to use frames and iframes.
Ah, the joys of frames!
>>> The page where this javascript is invoked is at the page that has an
>>> iframe called bottom. The iframe has frames that have frames.
>>> My question; without touching the other pages (I can only have
>>> javascript on this page); how can I set the document location of the
>>> other sub frames, especially if the bottom.location page hasn't even
>>> been set yet.
>>> NO, I cannot change the frame structure.
>>> E.g.
>>> bottom.location='/a/bottomset.html';
>>> This page has frames
>>> My Page
>>> <iframe name="bottom" id="bottom" src="empty_page.html" />
>>> My Javascript on My Page.
>>> function onloadTracking() {
>>> try {
>>> bottom.location='/a/bottomset.html';
>>>
bottom.frames[1].frames[1].frames[0].location='/a/page';
>>>
bottom.frames[1].frames[1].frames[1].location='/a/blank_wht.html';
>>> } catch(e) {
>>> alert(e);
>>> }
>>> }
>> bottom.location='/a/bottomset.html';
>>
>> The issues is that, these won't get set because the bottomset page
>> hasn't loaded yet.
>>
>>>
bottom.frames[1].frames[1].frames[0].location='/a/page';
>>>
bottom.frames[1].frames[1].frames[1].location='/a/blank_wht.html';
>
> I tried to use something with addEventListener; something like the
> following.
You do realize that good ol' IE does not support "addEventListener", but
MS has their own limited "attachEvent"
>
> function goForIt(evt) {
> alert('testing');
> }
> function testWaitLoop() {
> var bottomIFrame = document.getElementById("bottom");
> bottomIFrame.location = 'bluepage.html';
> bottomIFrame.addEventListener("load", goForIt, true);
> }
Since you are stuck with frames and required to use JavaScript you might
get a better response on a JavaScript group:
comp.lang.javascript
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
|