How do I detect if the Browser can display SVG files? [Archive] - XML Elves

How do I detect if the Browser can display SVG files?

freedoms
08-16-2004, 11:52 AM
At the moment I use a Java APPLET to display the animated text I need, and I
have the basic knowledge to adapt and compement Michel's SVG, but
persuading the common Browsers to display these in a backwards-compatible and
standards-compliment manner is proving problematic:

I have worked out the best method of using OBJECT instead of APPLET with
Java, using OBJECT with SVG (EMBED not being standard), but no common
Browsers correctly handle nested OBJECTs or nested combinations of OBJECTs
and APPLETs correctly.

Current (temporary file) experiments at http://Freedoms.4t.com/ffa3.htm

This leaves me with two approaches:

1. Retain the APPLET, add alternative text being a link to an alternative
page containing an OBJECT which has alternative text of SSI-included source
text (used by the original Java).

1b. When SVG is more widely supported, swap to an OBJECT on the main page,
with alt text being a link to alternative page using an APPLET.

2. Retain the APPLET, add alternative text being SSI-included text (incase
javascript not supported). Add javascript to detect if SVG supported. If it
is, use innerHTML property to overwrite the APPLET or a DIV containing it
with SVG OBJECT, but, em, reading the by-that-time existing alternative text
and re-using it.

Please comment on the above approaches.

For method 2, could I adapt the following PD code (for detecting the ability
to display Flash files), to detect for SVG?:


var MM_contentVersion=6;
var plugin=(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if(plugin)
{
var words=navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i=0;i<words.length;++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion=words[i];
}
var MM_FlashCanPlay=MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1))
{
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay=(IsObject(CreateOb ject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}

Anonymous
08-17-2004, 05:25 AM
Perhaps this link
http://www.adobe.com/svg/workflow/autoinstall.html

Michel

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum