大家肯定都有自己的见解。
说 说 你 为 什 么 这 样 认 为......
============================
抄录一段代码:
dojo.a11y = {
checkAccessible: function(){
if(this.accessible === null){
this.accessible = false;
//default
if(this.doAccessibleCheck == true){
this.accessible = this.testAccessible();
}
}
return this.accessible;
/* Boolean */
}, //《---------大家注意:函数之间居然用读号分隔(不是分号)。
testAccessible: function(){
this.accessible = false;
//default
if (dojo.render.html.ie ||do
jo.render.html.mozilla){
var div =do
cument.createElement("div"
;
//div.style.color="rgb(153,204,204)";
div.style.backgroundImage = "url(/""
+ this.imgPath + "/tab_close.gif/"
";
// must add to hierarchy before can view currentStyle below
dojo.body().appendChild(div);
// in FF and IE the value for the current background style of the added div
// will be "none"
in high contrast mode
// in FF the return value will be url(invalid-url
when running over http
var bkImg = null;
if (window.getComputedStyle ) {
var cStyle = getComputedStyle(div, ""
;
bkImg = cStyle.getPropertyValue("background-image"
;
}else
{
bkImg = div.currentStyle.backgroundImage;
}
var bUseImgElem = false;
if (bkImg != null &&
(bkImg == "none"
|| bkImg == "url(invalid-url
"
)) {
this.accessible = true;
}
/*
if(this.accessible == false &&
document.images){
// test if images are off in IE
var testImg = new Image();
if(testImg.fileSize) {
testImg.src = this.imgPath + "/tab_close.gif";
if(testImg.fileSize < 0){
this.accessible = true;
}
}
}*/
dojo.body().removeChild(div);
}
return this.accessible;
/* Boolean */
}
}