对象添加原型方法,添加新的数据类型
语法格式:
U.UF.EV.addPrototype 对象添加原型方法,添加新的数据类型,或者在已有数据类型上扩充功能,
例如:String,Number,Array,Object,Guid等
U.UF.EL.addPrototype (obj, str, fun) 调用函数
参数一:{object} obj 数据类型 例如string、number等
参数二:{string、object} str 当这个参数为string的时候下述函数有效
参数三:{function} fun 原型对应的函数
前端javascript调用数据库存储过程示例(可在编辑区域修改参数):
var use = function(){
this.xuesheng = ['zs,li'];
};
U.UF.EV.addPrototype (use , 'addStu', function(xs) {
this.xuesheng.push(xs)
});
var stu = new use();
stu.addStu('ww');
$$('div',{"innerHTML":stu.xuesheng});
运行结果展示区域: