var initEvent = { list:['editor'], editor:function () { var obj = $("[dataType = 'text']"),len = obj.size(),id,ue; for(var i = 0 ;i<len;i++) { id = obj.eq(i).find('textarea').attr('id'); if(typeof id != 'undefined') { ue = new UE.ui.Editor(); ue.render(id); //UE.getEditor(id).reset(); } } }, init:function () { for(var i in this.list) { if(typeof this.list[i] != 'undefined' && typeof this[this.list[i]] == 'function') { this[this.list[i]](); } } } }; $(function () { initEvent.init(); })