Accessing DOM elements in an embedded doc

Discussion in 'Javascript' started by Julius Mong, Apr 5, 2004.

  1. Julius Mong

    Julius Mong Guest

    Dear all, I have something like this:

    <html... >
    <embed ...>
    </html>

    Am I out of luck if I wanted to access the embedded DOM and manipulate its
    content?

    Or if I have:

    <svg ...>
    <svg ...>
    ...
    </svg ...>
    </svg>

    Is it possible to manipulate the inner svg elements from a script defined in
    the outer? I tried

    var SVGDoc = evt.getTarget().getOwnerDocument();
    var SVGRoot = SVGDoc.getDocumentElement();
    var SVGInner = SVGDoc.getElementsByTagName("svg");
    SVGInner.currentTranslate.x += dx;

    and it won't work, if I did:

    var SVGDoc = evt.getTarget().getOwnerDocument();
    var SVGRoot = SVGDoc.getDocumentElement();
    SVGRoot.currentTranslate.x += dx;

    then the entire outer document gets translated, I've also tried
    SVGDoc.getElementByID and getfirstChild with no luck... can someone point me
    in the right direction?

    Thanks, Jules
    Julius Mong, Apr 5, 2004
    #1
    1. Advertising

  2. Julius Mong

    Julius Mong Guest

    Sorted.
    Julius Mong, Apr 5, 2004
    #2
    1. Advertising

  3. Julius Mong

    Ivo Guest

    "Julius Mong" wrote
    > Sorted.
    >


    Great!
    Please tell.
    Ivo
    Ivo, Apr 5, 2004
    #3
  4. Julius Mong

    Julius Mong Guest

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

    An SVG embed in an HTML and then do whatever you want with the SVG :)

    "Ivo" <> wrote in message
    news:4071bab5$0$26017$...
    > "Julius Mong" wrote
    > > Sorted.
    > >

    >
    > Great!
    > Please tell.
    > Ivo
    >
    >
    Julius Mong, Apr 5, 2004
    #4
  5. Julius Mong

    Ivo Guest

    "Julius Mong" wrote
    > SVGDoc = document.embeds["svgPage"].getSVGDocument();
    > SVGRoot = SVGDoc.getDocumentElement();
    >
    > An SVG embed in an HTML and then do whatever you want with the
    > SVG :)


    Excellent stuff.
    Cheers,
    Ivo, Apr 5, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Wallace
    Replies:
    0
    Views:
    456
    John Wallace
    Jul 22, 2003
  2. Matt
    Replies:
    3
    Views:
    477
    Tor Iver Wilhelmsen
    Sep 17, 2004
  3. Julius Mong
    Replies:
    1
    Views:
    1,974
    Martin Honnen
    Apr 5, 2004
  4. Gerald Aichholzer
    Replies:
    2
    Views:
    2,478
    Gerald Aichholzer
    Jun 27, 2006
  5. Chris Seberino
    Replies:
    3
    Views:
    729
    Stefan Behnel
    Jun 12, 2009
Loading...

Share This Page