日期:2014-05-16  浏览次数:20308 次

玩CSS和JS的大手请进!---帮忙解释一行话!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 
<html xmlns= "http://www.w3.org/1999/xhtml " xmlns:ie> 
<head> 
<title> IE Specific Browser Detect </title> 
<meta http-equiv= "content-type " content= "text/html; charset=gb2312 "> 
<style> 
<!-- 
  @media all { IE\:clientCaps {behavior:url(#default#clientCaps)}}  
--> 
</style> 
</head> 
<body> 
<ie:clientcaps id= "oClientCaps "> 
<script type= "text/jscript "> 
<!-- 
document.write( "系统语言: " + oClientCaps.systemLanguage + " <br> "); 
// --> 
</script> 
</body> 
</html> 
-------------------------------- 
<!-- 
  @media all { IE\:clientCaps {behavior:url(#default#clientCaps)}}  
--> 
上面的这句话什么意思!代码是为了测试客户端系统语言,但是{ IE\:clientCaps {behavior:url(#default#clientCaps)}} 这种写法有什么说道??说的一定要具体。

------解决方案--------------------
clientCaps Behavior:

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

这是IE新增默认行为(htc很少用),当然利用web行为(就是利用htc方式可以完成大量特殊工作)

<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>