$chk || $try || periodical || $each

1、

window.addEvent('domready', function() {

var myObject;
myObject = 0;
if($chk(myObject)) {
alert('Object exists');//run this
} else {
alert('Object does not exist');
}

});

 

2、

$try(//如果第一个function有错误,那么会执行下面的正确函数

function one(){},

function two(){}

......

)


3、

var counter = 0;
var moveLeft = function() {
$('bluebox').tween('margin-left', (counter+1)*100);
counter++;
if(counter == 5) {
$clear(moving);
}
}
var moving = moveLeft.periodical(1000);
});


4、

$each(myCars, function(priority, car)

priority是值(value)

car是键(key)

 

posted @ 2010-01-12 10:11  kid的笔记本  阅读(234)  评论(0编辑  收藏  举报