Accessing DOM elements in an embedded doc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Julius Mong

    Accessing DOM elements in an embedded doc

    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() .getOwnerDocume nt();
    var SVGRoot = SVGDoc.getDocum entElement();
    var SVGInner = SVGDoc.getEleme ntsByTagName("s vg");
    SVGInner.curren tTranslate.x += dx;

    and it won't work, if I did:

    var SVGDoc = evt.getTarget() .getOwnerDocume nt();
    var SVGRoot = SVGDoc.getDocum entElement();
    SVGRoot.current Translate.x += dx;

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

    Thanks, Jules


  • Julius Mong

    #2
    Re: Accessing DOM elements in an embedded doc

    Sorted.


    Comment

    • Ivo

      #3
      Re: Accessing DOM elements in an embedded doc

      "Julius Mong" wrote[color=blue]
      > Sorted.
      >[/color]

      Great!
      Please tell.
      Ivo


      Comment

      • Julius Mong

        #4
        Re: Accessing DOM elements in an embedded doc

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

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

        "Ivo" <no@thank.you > wrote in message
        news:4071bab5$0 $26017$1b2cd167 @news.wanadoo.n l...[color=blue]
        > "Julius Mong" wrote[color=green]
        > > Sorted.
        > >[/color]
        >
        > Great!
        > Please tell.
        > Ivo
        >
        >[/color]


        Comment

        • Ivo

          #5
          Re: Accessing DOM elements in an embedded doc

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

          Excellent stuff.
          Cheers,


          Comment

          Working...