How to access embeds in another frame

J

Julius Mong

Dear all, if I have something like this:

<html>
<body>
<embed src="..." id="svgPage" />
</body>
</html>

and I did this in the same doc:

SVGDoc = document.embeds["svgPage"].getSVGDocument();
SVGRoot = SVGDoc.getDocumentElement();

I will get the SVG doc in the embed, fantastic.

But if I have 2 frames, with "left" and "right" named respectively, and want
to access the embed in the right frame which contains the html doc above. I
tried this:

SVGDoc = parent.right.document.embeds["svgPage"].getSVGDocument();
SVGRoot = SVGDoc.getDocumentElement();
fx = SVGRoot.currentTranslate.x;

And IE would complain that line 14 char 5 : Object required, and line 14 is
the fx = ... line so I suppose SVGDoc wasn't initiated properly and hence
SVGRoot wasn't either. I have no idea why this wouldn't work... could
someone point me in the right direction please...

Thanks, Jules

The html containing the 2 frames is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<frameset cols="20%,*" ...>
<frame name='left' src='left.html' scrolling='auto' ...>
<frame name='right' src='page.html' border='0' ...>
</frameset>
</html>
 
M

Michael Winter

[snip]
SVGDoc = parent.right.document.embeds["svgPage"].getSVGDocument();
SVGRoot = SVGDoc.getDocumentElement();
fx = SVGRoot.currentTranslate.x;

And IE would complain that line 14 char 5 : Object required, and line 14
is the fx = ... line so I suppose SVGDoc wasn't initiated properly and
hence SVGRoot wasn't either. I have no idea why this wouldn't work...
could someone point me in the right direction please...

At a guess (I've never used SVG), I'd say the problem lies with the
getDocumentElement() method call. The ECMAScript bindings for SVGDocument
and its base interfaces don't include that method; it is, in fact, a Java
method. Try using the Document.documentElement property instead.

It would be much easier if you could post a complete example somewhere.

Mike
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top