Dear all, according to the ASV3 manual known problem section, to make an <a>
execute some Javascript onclick:
http://www.google.co.uk/search?q=cac...=en&ie=UTF-8#5
4. Due to design limitations of Netscape, avoid using HTML with the
following form: <a href="#" onclick="myScriptWhichModifiesSVG()">The problem
is that JavaScript responds to the onclick event and begins executing the
script, but then Netscape also responds to the fact that you clicked on a
link, and interrupts JavaScript to re-load the current page. This conflict
can be avoided by re-writing the code as follows: <a
href="javascript:myScriptWhichModifiesSVG()">
Now that supposedly only occurs in Netscape, but I'm using IE6 + ASV6 and I
am experiencing the exact same problem:
<a xmlns="http://www.w3.org/2000/svg" xlink:href="#"
onclick="document.getElementById('svg0').setAttrib ute('viewBox','56.8436
42.5733 308.911 143.705'); ">
<path d="bla" etc />
</a>
But if I did:
<a xmlns="http://www.w3.org/2000/svg"
xlink:href="javascript:document.getElementById('sv g0').setAttribute('viewBox
','56.8436 42.5733 308.911 143.705'); ">
<path d="bla" etc />
</a>
This will cause IE to throw an error saying document.getElementById()
returns null, but if I replaced <A> with <G> like below:
<g xmlns="http://www.w3.org/2000/svg"
onclick="javascript:document.getElementById('svg0' ).setAttribute('viewBox','
56.8436 42.5733 308.911 143.705'); ">
<path d="bla" etc />
</g>
It works perfectly fine, and so I have no idea if it is at all possible to
run Javascript in href in SVG anchors. Please help.
Thanks, Julius