Re: linking from svg to html frames

"Chad" <chadnash@optusnet.com.au> wrote in message
news:3F94C207.38250C71@optusnet.com.au...
>
> 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.

There is absolutely no need to use javascript here.

>     <script type="text/javascript"> <!--
>           function inHtml(a) {
>             top.ff1.location=a;

This isn't specified in any W3 recommendation or other standard, so there is
nothing that can be expected to work.

>       <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 target="ff1" href="frames.html#f4">...</a>

For HTML, there's nothind defined in HTML for your above javascript, indeed
I know it fails in a number of UA's.


> <svg>
>
>   <script type="text/javascript"> <!--
>       function inSvg(a) {
>         top.ff1.location=a;
>       }
>     --> </script>


This is just a script error, I would strongly recommend not using scripting
until you understand a little bit more about it - first thing to learn is
when not to use it.  (--> at the end is a script error, nothing more)

<a target="ff1" xlink:href="frames.html#f4"><circle cx='10' cy='10' r='5'
/></a>

None of your javascript (including the ones which appear to work) have any
reason to work other than luck, don't use them, especially as there's no
need.

For questions such as this the svg-developers mailing is the appropriate
place to discuss them.

Jim.

Received on Tuesday, 21 October 2003 05:17:36 UTC