Client Services
Client Aids
Client-Side Browser Capabilities
BCaps is a Client-Side Browser Capabilities detection script available on all
Zenica Hosted Sites. It is based on the detection technology developed by
Cyscape and distributed with the .NET Framework but modified for inclusion as a
client-side script for use on sites that are not .NET enabled. Note: it will
not work on browsers that have Scripting Disabled, so you will have to code
accordingly.
Implementation
Cut and paste the following into the head region of your page. (Between the
<head> and </head> tags)
NOTE: This is specific to Zenica Hosted Sites. If you want to 'Borrow' this
code you will need to download the BCaps.js file and change the reference to
suit.
How to Use
Implement a call to the function BCaps() wherever you need to determine a
browser capability. BCaps only tests the browser capabilities on the first
call, all subsequent calls return the original object, which improves
efficiency.
E.g.
if (BCaps().type == "IE6")
{
if (BCaps().crawler == true)
{
// do stuff for crawler
}
else
{
// do other stuff
}
}
BCaps does NOT return actual browser settings - only the browser capabilities.
I.e. the browser may be CAPABLE of handling cookies, but cookies may
ACTUALLY be disabled, in which case BCaps would still indicate true. For true
client detection see BrowserHawk from Cyscape.
Documentation
The following parameters are available :-
| Parameter |
Type |
Additional Comments |
| ak |
bool |
|
| aol |
bool |
|
| authenticodeupdate |
bool |
|
| activexcontrols |
bool |
|
| browser |
string |
"IE"
"PIE"
"WebTv"
"Opera"
"Netscape"
"PowerBrowser" |
| version |
string |
eg "4.5" |
| majorversion |
string |
eg "4" |
| minorversion |
string |
eg ".0" |
| frames |
bool |
|
| tables |
bool |
|
| cookies |
bool |
Capable - may be disabled by options |
| backgroundsounds |
bool |
|
| vbscript |
bool |
|
| javascript |
bool |
|
| javaapplets |
bool |
|
| win16 |
bool |
Windows 3.1 etc |
| win32 |
bool |
Windows 98 et al. |
| beta |
bool |
|
| sk |
bool |
|
| crawler |
bool |
BCaps defaults to true, BrowserCaps defaults to false. |
| cdf |
bool |
|
| gold |
bool |
|
| tagwriter |
string |
"HtmlTextWriter"
"Html32TextWriter" |
| ecmascriptversion |
string |
eg "1.0" |
| msdomversion |
string |
eg "1.0" |
| platform |
string |
"Win95"
"Win98"
"WinXP"
"Win2000"
"WinNT"
"Win16"
"WinCE"
"Mac68K"
"MacPPC"
"UNIX"
"WebTV" |
| clrversion |
string |
|
| css1 |
bool |
|
| css2 |
bool |
|
| xml |
bool |
|
| type |
string |
Combine browser and majorversion i.e. IE4 |
We are not affiliated with Cyscape, and Cyscape do not endorse our
product. Please visit Cyscape at
www.cyscape.com for the ultimate browser
detector.
This program is offered "as is" without any warranty, guarantee or support. Use
at your own risk.
How and Why
Browsers are different. It's as simple as that. Even browser editions are
different, IE4, IE5 and IE6 all behave slightly differently from each other.
As web developers we'd like to place our page on a server and have everyone view
it identically.
It just doesn't happen.
So what can we do? There are a number of ways to handle this situation :-
1) Ignore it - it will go away by itself. This has many merits, it's certainly
easy to implement, and as more and more browsers begin to adhere to DOM
standards, it has a surprising chance of coming true. In the mean time .....
2) Aim for commonality. Use just the basic common standards and avoid all the
flashy extras available on some versions. Unfortunately it can be hard to find
just what is basic and what is extra. Even CSS used to be an enhancement to
some browsers, and should we use CSS1 or CSS2? Add to that, different makers
implement the standards fractionally uniquely. What a mess .....
3) Detect the browser version and code specifically to suit. The problem here is
how to keep abreast of all the changes - are you an expert on browser
detection?
Cyscape is one of the leaders in capability detection - check out BrowserHawk at
www.cyscape.com. They are the providers of BrowserCaps the in-built
detection scheme provided by the .NET framework.
Unfortunately, if you don't have your own server it's going to be hard to take
advantage of.
Enter BCaps
BCaps is a detection routine based on BrowserCaps, but provided as a client-side
feature of all Zenica servers.
Install it within your page and let us worry about keeping it current. See
details (left) for complete documentation.