SVG – Learning by Coding

[ get_setSrc.svg --> Grafik anzeigen ]

 1: 
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
 2: 
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"

 3: 
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [

 4: 
  <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">

 5: 
]>

​ 6:  7: 
<!-- SVG Learning by Coding http://www.datenverdrahten.de/svglbc/ -->

 8: 
<!--    AuthorDrThomas Meinike 04/03 thomas@handmadecode.de     -->

​ 9: 10: 
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

​11: 12: 
  <title>SVG Learning by Coding</title>

13: 
  <desc>SVG-Spezifikation in Beispielen</desc>

​14: 15: 
  <defs>

​16: 17: 
    <script type="text/javascript">

18: 
      <![CDATA[

​19: 20: 
      var src,doc;

​21: ​22: 23: 
      function getSource()

24: 
      {

25: 
        src=window.getSrc();

26: 
        doc=src.substring(src.lastIndexOf("/")+1,src.length);

27: 
        alert("Aktuelles Dokument: \n"+doc);

28: 
      }

​29: ​30: 31: 
      function setSource(src)

32: 
      {

33: 
        window.setSrc(src);

34: 
      }

​35: 36: 
      ]]>

37: 
    </script>

​38: 39: 
  </defs>

​40: 41: 
  <text x="20" y="30" style="fill: #000; font-size: 24px">

42: 
    Die Methoden getSrc() bzwsetSrc() [1]</text>

​43: 44: 
  <a xlink:href="" cursor="pointer" onclick="return false">

45: 
    <text x="40" y="70" style="fill: #F00; font-size: 18px"

46: 
      onclick="getSource()">Aktuelles Dokument</text>

47: 
  </a>

​48: 49: 
  <a xlink:href="" cursor="pointer" onclick="return false">

50: 
    <text x="230" y="70" style="fill: #00C; font-size: 18px"

51: 
      onclick="setSource('get_setSrc_2.svg')">

52: 
      get_setSrc_2.svg laden</text>

53: 
  </a>

​54: 55: 
</svg>

[zum Anfang]