xlink:href test case

Test case for xlink:href; note the different behaviors across browsers


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
  <meta http-equiv="X-UA-Compatible" content="IE=9"/>

             <script type="text/javascript">
       <![CDATA[
            function testUpdatesetAttrib()
            {
                var err = document.getElementById("err");
                err.setAttribute("xlink:href", "ie7_logo.png" );
               
            }
            function testUpdatesetAttribNS()
            {
                var err = document.getElementById("err");
                err.setAttributeNS("xlink","href", "ie7_logo.png" );
               
            }

       ]]>
        </script>
 </head>
 <body>
    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="container" width="800" height="800"  >
            <image xlink:href="ie7_logo2.png" x="200" y="50" width="400" height="400" id="err" />
            <image xlink:href="ie7_logo.png" x="600" y="50" width="400" height="400" id="err" />
    </svg>
  <input type="button" onclick="testUpdatesetAttrib()" value="Use settAttribute()" />
  <input type="button" onclick="testUpdatesetAttrib()" value="Use settAttributeNS()" />
 </body>
</html>

Received on Thursday, 15 April 2010 14:51:47 UTC