I've tried contentDocument, contentWindow and everything

R

Richard P

I've feel that I have tried everything possible but I still cannot get
my code to work in both netscape version 6 and IE.

My Javascript is in XSL files but this should not matter.

I am using the frameset below, the ids are different but the names are
the same. The names are the same because I have a function to minimise
and maximise a frame given its name and this uses getElementsByName.

<frameset rows="50,50" id="fsMain">
<frame id="frame1" name="frame"
src="page.asp?xml=frame1&amp;xsl=frame1"/>
<frame id="frame2" name="frame"
src="page.asp?xml=frame2&amp;xsl=frame2"/>
</frameset>

In frame1 I have a function called 'testFrameGet'.

'testFrameGet' calls function frameGot that exists in frame2.

framegot displays an alert box.

So far I have tried:

//******************
// The following line works in IE but not in Netscape.
// alert( parent.frames['frame2'].frameGot() );
//******************
// this works in IE only.
alert( top.frame2.frameGot() );
//******************
// this works in netscape and IE but only returns the window title,
// I want to run a function.;
//var objFrame = frameGet('frame2');
//if ( objFrame.contentDocument )
//{
//var src_doc = objFrame.contentDocument;
//alert(src_doc.title);
//}
//else
//{
//alert('no content')
//}
//******************
//None of these work.
//var objFrame = frameGet('frame2');
//objFrame.contentDocument.document.head.frameGot() );
//objFrame.contentDocument.head.frameGot() );
//objFrame.contentDocument.frameGot() );
//objFrame.contentWindow.document.head.frameGot() );
//objFrame.contentWindow.head.frameGot() );
//objFrame.contentWindow.frameGot() );
//alert(doc.frameGot() );
//alert( parent.window.frames['frame2'].frameGot() );
//alert( parent.frames['frame2'].window.frameGot() );
//alert( objFrame.frameGot() );

Any ideas?
 
M

Martin Honnen

Richard said:
I've feel that I have tried everything possible but I still cannot get
my code to work in both netscape version 6 and IE.

My Javascript is in XSL files but this should not matter.

I am using the frameset below, the ids are different but the names are
the same. The names are the same because I have a function to minimise
and maximise a frame given its name and this uses getElementsByName.

<frameset rows="50,50" id="fsMain">
<frame id="frame1" name="frame"
src="page.asp?xml=frame1&amp;xsl=frame1"/>
<frame id="frame2" name="frame"
src="page.asp?xml=frame2&amp;xsl=frame2"/>
</frameset>

I strongly suggest to use different names for different frames, then you
can access
parent.frames.frameName
to access a frame cross browser
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top