/**
* 将通用函数封装在CC对象中.
*/
var CC = {
//用于产生唯一ID.
uniqueId: 0,
/**
* <script></script>标签匹配.
*/
ScriptExpAll: new RegExp('<script[^>]*>([\\S\\s]*?)<\/script>', 'img'),
ScriptExpOne: new RegExp('<script[^>]*>([\\S\\s]*?)<\/script>', 'im'),
/**
* <style></style>标签匹配.
*/
StyleExpAll: new RegExp('<style[^>]*>([\\S\\s]*?)<\/style>', 'img'),
StyleExpOne: new RegExp('<style[^>]*>([\\S\\s]*?)<\/style>', 'im'),
/**
* object : 一个可枚举对象.
* callback:枚举回调,如果有参数,效果如element.callback(args...).
* 无参数无length属性element.callback(name,value)否则element.callback(i,element);
* callback返回false中断枚举.
*/
each: function(object, callback, args) {
if (!object) {
return object;
}
if (args) {
if (object.length == undefined) {
for (var name in object)
if (callback.apply(object[name], args) === false)
break;
} else
for (var i = 0, length = object.length; i < length; i++)
if (callback.apply(object[i], args) === false)
break;
} else {
if (object.length == undefined) {
for (var name in object)
if (callback.call(object[name], name, object[name]) === false)
break;
} else
for (var i = 0, length = object.length, value = object[0]; i < length && callback.call(value, i, value) !== false; value = object[++i]){}
}
return object;
}
}
ScriptExpAll, ScriptExpOne ,eack 这是什么意思啊