一段js的理解 ( 积分: 50 )

  • 主题发起人 linuxping
  • 开始时间
L

linuxping

Unregistered / Unconfirmed
GUEST, unregistred user!
在JavaScript中这样定义:
vardo
jo={
isDebug:true;
isColor:true;
DebugContainerID:undefine;
};
这种格式到底定义什么?
好像不是在定义类?也不是在定义函数吧?也不是枚举?
到底该怎么理解?
另外,js单步调试用什么工具?(不要说vc。net,我没装)
 
Y

yangxiao_jiang

Unregistered / Unconfirmed
GUEST, unregistred user!
js的调试工具
http://www.blogjava.net/flyingis/archive/2006/06/16/53389.html
应该是定义类型。我没有用过这种形式的。
 
E

easykoala

Unregistered / Unconfirmed
GUEST, unregistred user!
是在定义类
 
L

linuxping

Unregistered / Unconfirmed
GUEST, unregistred user!
不像在定义类。。。
类的定义:
function Class1(){
this.name="NAME";
functiondo
Something(AAction /*string*/){
alert('DoSomting');
}
}
有人说是在定义结构,我觉得更像结构。。。你认为呢?
 
O

oj911

Unregistered / Unconfirmed
GUEST, unregistred user!
是一个哈西表结构
 
D

dreamfly1024

Unregistered / Unconfirmed
GUEST, unregistred user!
一个小对象啦
 
L

linuxping

Unregistered / Unconfirmed
GUEST, unregistred user!
大家肯定都有自己的见解。
说 说 你 为 什 么 这 样 认 为......
============================
抄录一段代码:
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 */
}
}
 
顶部