Re: Jump to URL from SVG within a HTML page

Hi,

My solution is to call a script method inside the HTML from a script method 
in the SVG.

<html>
    <head>
        <script language="JavaScript">
            function doTheStuffInHtml(url)
            {
                window.location.href = url;
            }
        </script>
    </head>
    <body>
        <embed src="test.svg" name="test" height="40" width="40" 
type="image/svg-xml"/>
    </body>
</html>

<svg height="40" width="40">
    <defs>
        <script>
            function doTheStuffInSvg(url)
            {
                parent.doTheStuffInHtml(url);
            }
        </script>
    </defs>
    <rect x="10" y="10" height="20" width="20" 
onclick="doTheStuffInSvg('newPage.htm');" />
</svg>

---
Legendo metulas imitabere cancrum

Olivier Gérault
----- Original Message ----- 
From: "Kai Michael Poppe" <kmpoppe@informatik.uni-bremen.de>
To: <www-svg@w3.org>
Sent: Wednesday, March 09, 2005 4:02 PM
Subject: Jump to URL from SVG within a HTML page


>
> Hello list!
>
> I need definitive help here.
> I've got a SVG within an HTML-page via embed. The document consists of
> multiple filled Paths (> 400) each with its own ID - and upon the 
> mouseclick
> event, which i caught by the SVG Viewer JavaScript-DOM i want to reload 
> the
> HTML-Page (since i need this path's id...) but window.location.href
> (naturally) doesn't work.
>
> Could anyone please help me! Am at a loss here ...
>
> Kai M Poppe
>
>
>
>
> +---------------------------------------------------------------------+
> About Devoteam:
>
> Devoteam is an IT consulting group.
> Combining consulting and technology solutions offers enables
> Devoteam to provide its customers with independent advice and
> effective solutions to help them align their IT infrastructures
> with their operational objectives.
> In 2003, the group achieved a turnover of 126 million euros
> and counts 1,475 employees in seven European countries
> (Austria, Belgium, Denmark, Spain, France, Holland, UK, Czech republic)
> and the Middle East.
> Listed on the Euronext Paris Nouveau Marche
> www.devoteam.com
> +---------------------------------------------------------------------+ 

Received on Thursday, 10 March 2005 09:24:56 UTC