XML technologies / SVG / Manipulating graphics with external scripts / Summary, questions and exercises

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

Summary

  • SVG files can also be manipulated externally.

  • Any programming or scripting language supporting object access can be used.

  • In Internet Explorer 5.x for Windows, for example, JavaScript or VBScript can access the plug-in and the SVG graphic.

  • SVG also provides access to methods and properties of the browser’s object model.

  • This also enables timers, created with the methods setInterval or setTimeout.

Questions and exercises

  1. How must you define a function to be called through the setInterval method of the window object?

    The following exercises form a single unit.

  2. Create an SVG file with a named text element containing 00:00:00.

  3. Add a function replacing the existing text with the current time.

  4. Call this function once every second.

  5. Extend it so hours, minutes and seconds below 10 are also displayed with two digits.

  6. Insert the SVG graphic into an HTML page.

   

 

 

 

back to top