- From: Chad <chadnash@optusnet.com.au>
- Date: Tue, 21 Oct 2003 15:20:07 +1000
- 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 Chad <html> <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'/> </frameset> </html> html> <head> </head> <body> <script type="text/javascript"> <!-- function inHtml(a) { top.ff1.location=a; } --> </script> <h1>Refereneces in svg in one frame to other frames </h1> <p> I cant seem to change the location of sibling frames.<br> Is there a reference for this behaviour. </p> <p> <a target="top" href="http://www.svgfaq.com/Frames.asp">http://www.svgfaq.com/Frames.asp</a> 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> </p> <a name="f2">f2<a><br> <a name="f3"> <embed src="svg.svg" width="1000" height="200" name="svg" pluginspage="http://www.adobe.com/svg/viewer/install/main.html" 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> </body> </html> <svg> <script type="text/javascript"> <!-- function inSvg(a) { top.ff1.location=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' onclick='top.frames[0].location="frames.html#f4"'/> <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> </a> <circle cx='10' cy='90' r='5' onclick='window.frames[0].location="frames.html#f4"'/> <text x = '30' y='95'> try window.frames[0] as per my reading of http://www.svgfaq.com/Frames.asp</text> <circle cx='10' cy='110' r='5' onclick='window.parent.frames[0].location="frames.html#f4"'/> <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' onclick='window.parent.parent.frames[0].location="frames.html#f4"'/> <text x = '30' y='135'> try window.parent.parent.frames[0] in case I dont understand</text> <circle cx='10' cy='150' r='5' onclick='top.location="frames.html#f4"'/> <text x = '30' y='155'>Shows that you can refer to top</text> </svg>
Received on Tuesday, 21 October 2003 04:16:43 UTC