js换值 cookie
2018-08-10 本文已影响0人
_嘿嘿_
for (var i in objs) {
var obj = objs[i];
var item = {};
$.extend(item, obj);
item.text = obj.containername;
item.id = obj.containerid;
items.push(item);
}
imeWeb.setCookie = function (name, value, time) {
if(time == null) {
.cookie(name, value, { path: '/imeWeb'}); } else {.cookie(name, value, {expires: time, path: '/imeWeb'});
}
}
imeWeb.getCookie = function (name) {
return $.cookie(name);
}
/**
- 添加事件
- @param object
- @param type
- @param callback
*/
imeWeb.tools.addEvent = function(object, type, callback) {
if (object == null || typeof(object) == 'undefined') return;
if (object.addEventListener) {
object.addEventListener(type, callback, false);
} else if (object.attachEvent) {
object.attachEvent("on" + type, callback);
} else {
object["on"+type] = callback;
}
};