• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 18. JavaScript > Using Scripts in SVG

Using Scripts in SVG

Just in case you're completely in the dark on Web scripting, a script is a program written in a scripting language (JavaScript, for example) that carries out some kind of task within a Web page or other document, such as an SVG document. Although we're focusing on JavaScript, there are other types of scripting languages in use these days, including Microsoft's VBScript (Visual Basic Script). Scripts of any sort are added to an SVG file using the script element. To identify the scripting language, such as “JavaScript,” you can add a type attribute with the appropriate value (the MIME type of the scripting language).

For instance, if you were inserting a JavaScript script, you would add the following code to your SVG document:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint