SVG supported scripted

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SVG supported scripted

Dale Ellis-2
Hi all,

I have a old piece of code, which I think I got from Adobe for
performing a check to see if the browser supports SVG. It works ok for
IE, but it seems to assume that if its not IE then plugins need to be
checked. This to me doesn't seem to be valid anymore as some browsers
support SVG natively.

I have been googling to see If I can find a script that will determine
if SVG is suported for a browser, but no joy, cant find one. This is
how I imagine it would work, Returning true for for all browser and
versions that SVG is known to be supported on, checking for a plugin
on browsers that require a pluggin and returning true or false
depending on if its installed or not, and return false in all other
scenrios.

I would imagine this already exists, anybody know where I might find
this?

Thanks,
Dale
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|

Re: SVG supported scripted

Helder Magalhães
Hi Dale,


> I have a old piece of code, which I think I got from Adobe for
> performing a check to see if the browser supports SVG. It works ok for
> IE, but it seems to assume that if its not IE then plugins need to be
> checked. This to me doesn't seem to be valid anymore as some browsers
> support SVG natively.

Nope, the script from Adobe only properly checks for ASV.


> I have been googling to see If I can find a script that will determine
> if SVG is suported for a browser, but no joy, cant find one. This is
> how I imagine it would work, Returning true for for all browser and
> versions that SVG is known to be supported on, checking for a plugin
> on browsers that require a pluggin and returning true or false
> depending on if its installed or not, and return false in all other
> scenrios.

Yes, I've also struggled with it recently...


> I would imagine this already exists, anybody know where I might find
> this?

I did something like that for a demo [1] recently. Just "view source"
and search for the key methods: "hasNativeSVG" and "hasPluginSVG". I'm
using this check in order to insert a script required for SVG Web [2]
(SVG run-time implemented in Flash) whenever no SVG support is
available, as I've found that the library seems to mess with native
implementations whenever inserted into the document (more research is
needed).

Note that the plug-in checked currently only checks for ASV (3 and 6
beta) and Renesis (1.x, not V3), although there are a lot [3] more
plug-ins available for IE.

Finally, you may want to keep distinguishing plug-in vs. native
support in your application: native support will typically allow you
to do things a plug-in implementation can't, such as seamlessly
playing with other contexts (in the HTML environment, for example).
Nevertheless, ASV and even Renesis to some extend allow native-like
things to be performed.


> Thanks,
> Dale

Hope this helps,
 Helder


[1] http://heldermagalhaes.com/stuff/svg/demos/SVGObject-HTMLCanvasInteractors/
[2] http://code.google.com/p/svgweb/
[3] http://wiki.svg.org/Viewer_Matrix
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|

Re: SVG supported scripted

Jeff Schiller
Sheesh, I have a bad habit of only replying to the author and not the
mailing list.  Re-posting my opinion :)

On Oct 14, 6:17 am, Dale Ellis <[hidden email]> wrote:
> This to me doesn't seem to be valid anymore as some browsers
> support SVG natively.

I think the word you're looking for is "most" :)

In fact, all major browsers except IE have supported scripted SVG
since about 2006 so (in my opinion) there's almost no need to check.

My recommendation:  use an html:object referencing your SVG with HTML
fallback.  This scenario will mean that with IE users if a SVG plugin
is installed (ASV, Renesis, Saverese) then the SVG will still show up.

If you want to further check in script you can try to create a
namespaced <svg> element in script and fail out if that didn't work
perhaps?

Regards,
Jeff Schiller
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg