W3C home > Mailing lists > Public > www-svg@w3.org > October 2003

linking from svg to html frames

From: Chad <chadnash@optusnet.com.au>
Date: Tue, 21 Oct 2003 15:20:07 +1000
Message-ID: <3F94C207.38250C71@optusnet.com.au>
To: www-svg@w3.org

I have svg in one frame and I want a click on an svg object to change
the contents of a sibling frame.

the main problem is that I cant refer to the sibling frame in javascript
within the svg.

my attempt is at
http://home.vicnet.net.au/~hollow/chad/muck/frameset.html and the source
is below

Where is the specification of what is supposed to work?

Thanks in advance


  <frameset rows="1*,1*,1*">
    <frame scrolling='yes' name='ff1' src='frames.html#f1' id="ff1"/>
    <frame scrolling='yes' name='ff2' src='frames.html#f2'/>
    <frame scrolling='yes' name='ff3' src='frames.html#f3'/>


    <script type="text/javascript"> <!--
          function inHtml(a) {
    --> </script>
    <h1>Refereneces in svg in one frame to other frames </h1>
      I cant seem to change the location of sibling frames.<br>
      Is there a reference for this behaviour.
      <a target="top"
seems to say I can get at the frames
      <a name="f1">I have tried both object and embed<a><br>
      <span   onclick='top.ff1.location="frames.html#f4"'>just check
that html works</span><br>
    <a name="f2">f2<a><br>

    <a name="f3">

    <embed src="svg.svg" width="1000" height="200" name="svg"
    type="image/svg+xml" ></embed>

    <object type="image/svg+xml" data="svg.svg"
      NAME="svg" width="1000" height="200" >
      SVG HERE</object>

    <a name="f4">f4-WORKS<a><br>


  <script type="text/javascript"> <!--
      function inSvg(a) {
    --> </script>

  <circle cx='10' cy='10' r='5'  onclick='inHtml("frames.html#f4")'/>
  <text x = '30' y='15'>Works top frame jumps to f4-WORKS: call to
javascript in html - top.ff1 is good reference</text>

  <circle cx='10' cy='30' r='5'  onclick='inSvg("frames.html#f4")'/>
  <text x = '30' y='35'>Fail: call to same javascript in svg - top.ff1
NOT a good reference</text>

  <circle cx='10' cy='50' r='5' 
  <text x = '30' y='55'>Fail: in line javascript top.frames[0] is NOT a
good reference</text>

  <a target='ff1' xlink:href='frames.html#f4'>
    <circle cx='10' cy='70' r='5'/>
    <text x = '30' y='75'>LINK SORT OF WORK: can refer to the right
target ff1 but does not put it at #f4</text>

  <circle cx='10' cy='90' r='5' 
  <text x = '30' y='95'> try window.frames[0] as per my reading of 

  <circle cx='10' cy='110' r='5' 
  <text x = '30' y='115'> try window.parent.frames[0]  as per my reading
of http://www.svgfaq.com/Frames.asp</text>

  <circle cx='10' cy='130' r='5' 
  <text x = '30' y='135'> try window.parent.parent.frames[0]  in case I
dont understand</text>

  <circle cx='10' cy='150' r='5' 
  <text x = '30' y='155'>Shows that you can refer to top</text>

Received on Tuesday, 21 October 2003 04:16:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:53:59 UTC