SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Raphaelle's Avatar
    Join Date
    Jul 2006
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript with SVG not working in IE

    Hello,

    I'm trying to add some basic interaction to a SVG map of Africa, using Javascript. All I want is that when you rollover a country, the name appears and the country is highlighted - something simple.

    I'm new to SVG so I first read both part 1 and part 2 of the A List Apart articles about SVG.

    As you might know, there are many ways to use and embed SVG, but the best option for me seemed to be SVG Web, because it works on all browsers and allows scripting.

    In my HTML file I've put the SVG within a <script> tag as they recommend.

    I've tried really simple jQuery interactions such as prompting an alert box when clicking on a country, but it does not work in IE. I've tried with normal javascript too but it doesn't work. I'm trying to apply a behaviour to the <path> element of the SVG.

    It works fine in all intelligent browsers but not in IE6-7-8

    Any ideas?

    thanks

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    To the best of my knowledge Internet Explorer doesn't recongise SVG format files at all.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Zealot Raphaelle's Avatar
    Join Date
    Jul 2006
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No but as the A list apart article explains, it's possible to support IE by using a library such as SVGWeb, Ample SDK, and Raphael.

    SVGWeb seemed easy enough to use so I went for it. My SVG map is displaying just fine on IE6,7 and 8, but the javascript interactions I add will only work on clever browsers. It is specified that SVGWeb enables scripting on all browsers so I don't know what I'm doing wrong.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •