SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Checking to see if SVG is supported

    Hello!

    I'm using jQuery SVG and would like to check if the browser that the person is using will support SVG --- if not, they'll receive a polite message; is there anyway to check this using javascript?

    Thank you,

    Eric

  2. #2
    SitePoint Enthusiast Anthony.Barnes's Avatar
    Join Date
    Aug 2011
    Location
    Canberra, Australia
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which SVG wrapper are you using for jQuery, perhaps it has built in detection?

    You could also use the hasFeature function to detect support, but I'm not really sure about cross browser compatibility:
    Code:
    if (!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0")) {
        alert('Oops, your browser doesn't support svg');
    }

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick reply!

    -Eric


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
  •