I specifically chose "SVGTransform" because both Firefox and Opera
expose it as a native object. If you only wanted Firefox, you could
just do
if ("SVGElement" in window)And perhaps when Opera finally does expose SVGElement as a prototypable object, its support will be more complete. :) --- In [email protected], Guy Morton <[EMAIL PROTECTED]> wrote: > > Thanks Jason...that's exactly what I was after (though I may have to do > something to filter out opera, since I can't get that working yet). > > Guy > > jookeda wrote: > > You could try the following: > > > > function hasSVGSupport() { > > if ("SVGTransform" in window) { // Firefox, Opera > > return true; > > } > > else if ("ActiveXObject" in window) { // IE > > try { new ActiveXObject("Adobe.SVGCtl") } > > catch (e) { return false } > > return true; > > } > > else { > > return false; > > } > > } > > > > This does leave out WebKit nightly builds, which do support SVG, but > > not the SVG DOM, leaving it almost useful for advanced scripting. But > > if you needed to check for WebKit (say you were only using DOM2 > > methods), then the only way I can think of detecting this is: > > > > if (/AppleWebKit\/(\d+)/.exec(navigator.userAgent)) { > > return parseInt(RegExp.$1) >= 420; > > } > > > > > > > > -Jason Davis > > > > --- In [email protected], "Andreas Neumann" <neumann@> > > wrote: > > > >> all the detection codes that I use fail in one browser/OS or the > >> > > other. Most of them f.e. only > > > >> work in Windows. I have f.e. a browser on Linux or Mac which surely > >> > > has ASV and Flash > > > >> installed but these stupid plugin detection codes out there report > >> > > me to install one ... > > > >> I think it is a better idea to inform the user that he needs a > >> > > browser or plugin capable of > > > >> displaying SVG (and list the options: FF>1.5, Opera>9, ASV, Batik, > >> > > etc.) and maybe use an > > > >> intermediate page with a sample SVG file. This problem will go away > >> > > if all browsers support > > > >> SVG natively. > >> > >> Andreas > >> > >> > >> --- In [email protected], Guy Morton <guy@> wrote: > >> > >>> Anyone got some good detection code that is free to use? Preferably > >>> detects ASV and FF support if available. > >>> > >>> Guy > >>> > >>> > > > > > > > > > > > > > > > > > > ----- > > To unsubscribe send a message to: [EMAIL PROTECTED] > > -or- > > visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" > > ---- > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > ------------------------ Yahoo! Groups Sponsor --------------------~--> Everything you need is one click away. Make Yahoo! your home page now. http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/1U_rlB/TM --------------------------------------------------------------------~-> ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

