spacer
Yehuda Shiran May 9, 2001
Checking the Browser/Plug-in Combination
Tips: May 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
In some of your applications you may need to use Flash Audio and JavaScript directly, without any prepackaged APIs such as FlashSound JavaScript API. You will enjoy more features, methods, and properties, but you'll have to take care of all the tiny details that are taken for granted when using FlashSound API.

One of these tiny details is checking that the browser can support the Flash plug-in and JavaScript interpreter. This means the browser must be Netscape 4+ with Java-enabled for Mac or Win, or IE 4+ for Windows: (winIEpass || NNpass). The boolean variable winIEpass is true when navigator.appName includes "Microsoft", navigator.appVersion includes "Windows", and navigator.appVersion is 4 or higher:

winIEpass = ((navigator.appName.indexOf("Microsoft") != -1) && 
  (navigator.appVersion.indexOf("Windows") != -1)) && 
  (parseFloat(navigator.appVersion) >= 4) ? true : false;

The boolean variable NNpass is true when navigator.appName includes "Netscape", navigator.userAgent includes "Mozilla", navigator.appVersion is 4 or higher, and navigator.javaEnabled is true:

NNpass = ((navigator.appName == "Netscape") && 
  (navigator.userAgent.indexOf("Mozilla") != -1) && 
  (parseFloat(navigator.appVersion) >= 3) && 
  (navigator.javaEnabled())) ? true : false;

One of the problems of plug-ins is that if the user does not have the right browser version or the latest plug-in version, he or she will receive an error message, a broken plug-in icon, or other warning. For Flash graphics, it is suggested to have a second non-Flash version of your Web page. A simpler solution is to embed the interactive audio if and only if the browser/plug-in combination can play it. If it cannot, the audio is disabled and no error messages are displayed. Also, there are no forced plug-in installs. End users will leave your page very quickly once they are being troubled with plug-in installs and error messages. Use the variables above to conditionally embed your sound tracks.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags