clientCaps Behavior

MS Office DHTML, HTML & CSS

clientCaps Behavior


Provides information about features supported by Microsoft® Internet Explorer, as well as a way for installing browser components on demand.

Syntax

XML<Prefix:CustomTag ID=sID STYLE="behavior:url('#default#clientCaps')" />
HTML<ELEMENT STYLE="behavior:url('#default#clientCaps')" ID=sID>
Scriptingobject.style.behavior = "url('#default#clientCaps')"
object.addBehavior ("#default#clientCaps")

Possible Values

Prefix Prefix that associates the CustomTag with an XML namespace. This prefix is set using the XMLNS attribute of the HTML tag.
CustomTag User-defined tag.
sID String that specifies a unique identifier for the object.

Members

Remarks

The members listed in the preceding table might not be accessible through scripting until the window.onload event fires. Waiting for this event to fire ensures that the page is completely loaded, that all behaviors have been applied to corresponding elements on the page, and that all the behavior's properties, methods, and events are available for scripting. To prevent a scripting error—which would indicate that the object does not support a particular member—do not use any of the behavior-defined members before the window.onload event fires.

The clientCaps behavior is available as of Internet Explorer 5, in the Microsoft® Win32® and Unix platforms.

Example

This example retrieves all the properties exposed by the clientCaps behavior.

Sample Code

<HTML XMLNS:IE>
<HEAD>
<STYLE>
@media all {
   IE\:clientCaps {behavior:url(#default#clientCaps)}
}   
</STYLE>
</HEAD>

<BODY>
<IE:clientCaps ID="oClientCaps" />

<PRE id=oPre></PRE>

<SCRIPT>
<!--
function window.onload()
{
   sTempStr = "availHeight    = " + oClientCaps.availHeight    + "\n" + 
              "availWidth     = " + oClientCaps.availWidth     + "\n" + 
              "bufferDepth    = " + oClientCaps.bufferDepth    + "\n" +
              "colorDepth     = " + oClientCaps.colorDepth     + "\n" +
              "connectionType = " + oClientCaps.connectionType + "\n" +
              "cookieEnabled  = " + oClientCaps.cookieEnabled  + "\n" +  
              "cpuClass       = " + oClientCaps.cpuClass       + "\n" + 
              "height         = " + oClientCaps.height         + "\n" + 
              "javaEnabled    = " + oClientCaps.javaEnabled    + "\n" + 
              "platform       = " + oClientCaps.platform       + "\n" + 
              "systemLanguage = " + oClientCaps.systemLanguage + "\n" + 
              "userLanguage   = " + oClientCaps.userLanguage   + "\n" + 
              "width          = " + oClientCaps.width          + "\n" ;
		  
   oPre.innerText = sTempStr;		  
}
-->
</SCRIPT>
</BODY>
</HTML>
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

This example uses the getComponentVersion method of the clientCaps behavior to determine the browser version.

Sample Code

<SCRIPT>
function window.onload()
{
    var sVersion = oClientCaps.getComponentVersion ("{89820200-ECBD-11CF-8B85-00AA005B4383}","componentid");
	myText.innerHTML = "<FONT SIZE=4>You are running Internet Explorer " + sVersion + ".</FONT>";
}
</SCRIPT>


<BODY BGCOLOR="#FFFFFF" STYLE="behavior:url(#default#clientCaps)" ID="oClientCaps">
   :
<DIV ID="myText"></DIV>   
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

This example shows how to install the Internet Explorer Data Binding component, if the component does not already exist in the user's system.

Sample Code

<HEAD>
<SCRIPT>
function window.onload()
{
   // dynamically set the behavior through script
   oClientCaps.style.behavior = "url(#default#clientCaps)";

   var bDBAvailable  = false;
   var sDBVersion = '';
   var sDBID = "{9381D8F2-0288-11D0-9501-00AA00B911A5}"; 
   
   bDBAvailable = oClientCaps.isComponentInstalled(sDBID,"componentid");

   // if data binding is unavailable, install it
   if (!bDBAvailable)
   {
      oClientCaps.addComponentRequest (sDBID, "componentid");
	  bDBAvailable = oClientCaps.doComponentRequest();
   }
   :
}
</SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" ID="oClientCaps">
  :
<PRE ID="preText"></PRE>
  
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, Hn, HR, HTML, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, ISINDEX, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, NEXTID, NOBR, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, RT, RUBY, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, WBR, XML, XMP

See Also

client capabilitiesInternet Link, dhtml behaviorsInternet Link, using dhtml behaviorsInternet Link


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.