当前位置: 亚洲城ca88 > 计算机网络 > 正文

功能齐全并且比较时髦的Jquery通用开源框架之,

时间:2019-11-30 16:44来源:计算机网络
复制代码 代码如下:switch { 功效齐全况兼比较新颖的Jquery通用开源框架之【ejq.js】,jqueryejq.js case 'PD': 简介 ejq是风华正茂款极度精细的JS工具库,未压缩才50K,在jquery的底子上对jquery缺

复制代码 代码如下:switch {

功效齐全况兼比较新颖的Jquery通用开源框架之【ejq.js】,jqueryejq.js

case 'PD':

简介

ejq是风华正茂款极度精细的JS工具库,未压缩才50K,在jquery的底子上对jquery缺失部分作了很好的弥补效用。

valueUD = obj.id;

优点:

1、具有内置的沙盘模拟经营拆解深入分析引擎语法和angularjs相近减弱学习话费

2、能够方便的对JSON操作,增删查改

3、随机数成效相比康健

4、丰硕的通用函数,那一个函数是经过N多门类需求而且储存下去的,实用性很强。

 

id = objName;

效率介绍

var loadVUD = UserData.load;

一、随机数

       var num= $.random.getNum(10);//获取0-10之间的随机数字
       var num2 = $.random.getNumBetween(100,200);//获取100-200之间的随机数字
       var num3 = $.random.getNumBetweenLength(4, 5);//获取长度为4-5的随机数字
       var num4 = $.random.getNumByLength(10); //获取长度为10的随机数

       var w1 = $.random.getWord(10);//获取10位长度的随机(字母加数字)
       var w2 = $.random.getNumBetweenLength(2, 4);//获取2位长度到4位长度之间的随机(字母加数字)

       var guid = $.random.getGuid();//获取guid

 

if (loadVUD == null || loadVUD == undefined || loadVUD == '') {

二、对JSON的操作

        var json = [{ id: 1, name: "张三" }, { id: 2, name: "李四" }, { id: 3, name: "王五" }];

        //对json进行筛选获取1和2的json集合
        var json1And2 = $.linq.where(json, function (v) { return v.id == 1 || v.id == 2; });

        //获取id为1的对象
        var zs = $.linq.single(json, function (v) { return v.id == 1; });

        //获取id>1的第一个对象
        var list = $.linq.first(json, function (v) { return v.id > 1; });

        //排序
        var json2 = $.linq.order(json, "id", "desc");

        //移除id为1的对象
        $.linq.remove(json, function (v) { v.id == 1; });

        //是否存在ID为1的对象,因为让删了当然反回false
        var isAnyOne = $.linq.any(json, function (v) { v.id == 1 });

 

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

三、数据的双向绑定

第意气风发当下去像是angularjs,其实是ejq.js模仿angularjs自已兑现的沙盘模拟经营分析引擎,因为这几个职能才写了2天,有为数不菲职能还未来的急完成,会最在近7个月让它更是的周全。

今昔豆蔻梢头度贯彻了 异步和一齐的数码绑定成效,暂不协助运算符和逻辑条件,只作多少绑定依然够用了。

  $(function () {


            //申明模版引擎的作用域
            var model = $ejqApp.module("ng-app");
            //控制器操作
            model.controller("ctr1", function ($scope, $http, $con, $app, $tool, $event) {

                $scope.model = {
                    title: "哈哈",
                    list: [{ id: 1, name: "table1" }, { id: 2, name: "table2" }, { id: 3, name: "table3" }],
                    item: [{ id: 3, name: "table3" }, { id: 2, name: "table2" }, { id: 1, name: "table1" }],
                    id: 1
                };
                $scope.haha = { text: "haha " };


                //使用ajax
                $http.jsonList = {
                    url:"../json.json",//随机URL
                    type: "get",
                };

                //获取当前控制器
                var thObj = $con.getObj();
                //获取当前App
                var appObj = $app.getObj();


                //给当前控制器name注册事件实现双向绑定
                appObj.on("click", thObj.find("#name"), function () {


                    //更新model.Title
                    $scope.model.title ="哈哈"  $.random.getNumBetweenLength(8, 10);


                    //更换AJAX URL
                    if ($http.jsonList.url == "../json.json") {
                        $http.jsonList.url = "../jsonList.json";
                    } else {
                        $http.jsonList.url = "../json.json";
                    }

                    //重新绑定
                    $ejqApp.apps.bind()

                    alert("数据重新绑定成功")
                })


            })
            $ejqApp.apps.bind();
        })

计算机网络 1<body ng-app="ng-app"> <h1> 模仿angular.js双向绑定的DEMO </h1> <div ng-controller="ctr1"> <input id="name" type="button" value="Reset" /> <div> <h1>$scope.model</h1> {{model.title}} {{model.id}} <table ng-repeat="item in model.list"> <tr><td>{{item.id}}</td><td>{{item.name}}</td></tr> </table> <table ng-repeat="item in model.item"> <tr><td>{{item.id}}</td><td>{{item.name}}</td></tr> </table> </div> <h1>$scope.haha</h1> {{haha.text}} <h3>异步加载</h3> <table ng-repeat="item in jsonList"> <tr><td>{{item.desc}}</td><td>{{item.name}}</td></tr> </table> </div> </body> HTML

 

qNoTotalD[qIdNoStr[tmpTGId]] ;

四、常用函数

             //这个函数在写通用框架时比较好用
            var kvs = $.action.jsonDictionary({ id: 1, name: "张三" })//将json 转成[{key:id,value:1},{key:name:value:"张三"}] 


            //替换所有a(js中Replace只能替换一个比较2)
            $.action.replaceAll("abcdabc", "a", "-")


            //检测元素是否存在,当存在时执行回调函数,超时会自动停止检测
            $.action.elementNullComplate("#id", function () {

            });

            //循环执行检测选择器的元素是否有值,有则执行回调函数过,超过停止检测
            $.action.elementValueReady("#id", function () {


            })
            //让setTimeout可以指定执行的次数
            $.action.setTimeoutWidthNum(function () {

            }, 1000, 3);//1秒执行一次,第三次将停止

            //去掉最后一个字符
            $.action.trimEnd("adfaf,", ",");

            //指定位置插入字符
            $.action.insertStr("adfaf", 2, "2");

            //.NET MVC URL处理(可以有效的防止虚拟目录JS跳转URL错误)
            //layout.cshtml定义一个hidden <input id='hid' value="@Url.Content("~/")">
            $.action.url("/actionName/", "hid", "controllerName", "areaName") //生成的url如下 /xxx/areaName/controllerName/actionName
            $.action.url("/actionName/", "hid", "controllerName")
            $.action.url("/actionName/", "hid")

            //更多
            //$.action.htmlDecode
            //$.action.htmlEncode

 

}

五、调换和申明

用法很简短 $.convert.xxx  、$.ValiData.xxx 和 $.valiType.xxx

计算机网络 2

 

break;

六、浏览器相关操作

用法也很简单,用法如下:

$.request.queryString().id

$.response.open("/home.index",{id:1})

$.brovali.isIE()

计算机网络 3

 

case 'DANX':

七、通用扩充函数

        //拼接字符串1
        var str = "我是中国{0},你是哪国{0}".ejq_format("人");
        str = str.ejq_appendFormat(",它是哪国的{0}", "猫");


        //拼接字符串2
        var str2 = "我是中国{p},你是哪国{p}".ejq_format({p:"人"});
        str2 = str2.ejq_appendFormat(",它是哪国的{cat}", { cat: "猫" });


        var idObj = "#id".ejq_selector(); //相当于$("#id")


        var num = 1.2600.ejq_toFixed(2);//四舍五入取2位,和原生toFixed不一样

 

还应该有豆蔻梢头对效果就相当小器晚成生龙活虎的申明了

 

valueUD = obj.id;

GIT地址:

 

var objName = obj.name;

源码

计算机网络 4/*! * jQuery Library v2.1 * 说明:Jquery通用库 * 创造时间: sunkaixuan 二零一五-8-22 * 改正时间:二零一四-8-2 */ (function (window, jQuery, undefined) { jQuery.extend({ /*随机值*/ random: { //获取0-maxNum之间的私行数字 getNum: function (maxNum卡塔尔 { return $.random.getNumBetween(0, maxNum卡塔尔(قطر‎; }, //获取min-max之间的人身自由数字 getNumBetween: function (min, max卡塔尔 { max = max 1; return Math.floor(Math.random(卡塔尔 * (max - min卡塔尔卡塔尔(قطر‎ min; }, //获取长度为length的大肆数字 getNumByLength: function (length卡塔尔(قطر‎ { var array = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; var reval = ""; for (var i = 0; i < length; i ) { reval = array[$.random.getNumBetween(0, array.length - 1)]; } return reval }, //获取长度为minLength-maxLength之间的随机数 getNumBetweenLength: function (minLength, maxLength卡塔尔(英语:State of Qatar) { var length = $.random.getNumBetween(minLength, maxLength卡塔尔国; return $.random.getNumByLength(length卡塔尔(英语:State of Qatar); }, //获取长度wordLength(数字、字母)组成的字符串 getWord: function (wordLength卡塔尔 { var array = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; var reval = ""; for (var i = 0; i < wordLength; i ) { reval = array[$.random.getNumBetween(0, array.length - 1)]; } return reval; }, //获取长度为minLength-maxLength之间的妄动(数字、字母)组成的字符串 getWordBetweenLength: function (minLength, maxLength卡塔尔 { var length = $.random.getNumBetween(minLength, maxLength卡塔尔; return $.random.getWord(length卡塔尔国; }, getGuid: function (卡塔尔国 { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } }, /*linq*/ linq: { contains: function (thisVal, cobj) { if (jQuery.valiData.isEmpty(thisVal)) { return false; } return thisVal.toString().lastIndexOf(cobj.toString()) != -1; }, /*where*/ where: function (obj, action) { if (action == null) return; var reval = new Array(); $(obj).each(function (i, v) { if (action(v)) { reval.push(v); } }) return reval; }, single: function (obj, action) { if (action == null) return; var reval = null; $(obj).each(function (i, v) { if (action(v)) { reval = (v); } }) return reval; }, remove: function (obj, action) { var removeItem = $.linq.single(obj, action); obj.splice(jQuery.inArray(removeItem, obj), 1); }, /*any*/ any: function (obj, action) { if (action == null) return; var reval = false; $(obj).each(function (i, v) { if (action(v)) { reval = true; return false; } }) return reval; }, /*select*/ select: function (obj, action) { if (action == null) return; var reval = new Array(); $(obj).each(function (i, v) { reval.push(action(v)); }); return reval; }, /*each*/ each: function (obj, action) { if (action == null) return; jQuery(obj).each(function (i, v) { action(i, v); }); }, /*first*/ first: function (obj, action) { if (action == null) return; var reval = new Array(); $(obj).each(function (i, v) { if (action(v)) { reval.push(v); return false; } }) return reval[0]; }, order: function (obj, field, orderByType) { var p = obj; p.sort(function down(x, y) { if (orderByType != null && orderByType.toLocaleLowerCase() == "desc") { return (x[field] < y[field]) ? 1 : -1; } else { return (x[field] > y[field]) ? 1 : -1; } }) return p; } }, /*操作*/ action: { url: function (actionName, hid, controllerName, areaName) { if (hid == null) { hid = "HidUrlAction"; } var isAction = controllerName == null && areaName == null; var isControllerName = areaName == null && controllerName != null; var isArea = areaName != null; var hidValue = $("#" hid).val(); var regValue = hidValue.match("(^.*)/(. )/(. )/$"); var virtualDirectory = regValue[1]; if (isAction) { return hidValue actionName; } else if (isControllerName) { areaName = regValue[2] return (virtualDirectory "/" areaName "/" controllerName "/" actionName卡塔尔(قطر‎; } else if (isArea卡塔尔(英语:State of Qatar) { return (virtualDirectory "/" areaName "/" controllerName "/" actionName卡塔尔(قطر‎; } }, //移除最后三个字符 trimEnd: function (str, c卡塔尔(英语:State of Qatar) { var reg = new RegExp(c "([^" c "]*?)$"); return str.replace(reg, function (w) { if (w.length > 1) { return w.substring(1); } else { return ""; } }); }, htmlEncode: function (str) { return str.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); }, htmlDecode: function (str) { return str.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); }, textEncode: function (str) { str = str.replace(/&/gi, '&'); str = str.replace(/</g, '<'); str = str.replace(/>/g, '>'); return str; }, textDecode: function (str) { str = str.replace(/&/gi, '&'); str = str.replace(/</gi, '<'); str = str.replace(/>/gi, '>'); return str; }, //获取json的key和value jsonDictionary: function (json, key) { var reval = new Array(); for (key in json) { reval.push({ key: key, value: json[key] }卡塔尔国; } return reval; }, insertStr: function (str1, n, str2卡塔尔 { if (str1.length < n卡塔尔国 { return str1 str2; } else { s1 = str1.substring(0, n); s2 = str1.substring(n, str1.length卡塔尔; return s1 str2 s2; } }, //替换全数字符 replaceAll: function (str, findStr, reStr卡塔尔 { var reg = new RegExp(findStr, "g"卡塔尔(قطر‎; return str.replace(reg, reStr卡塔尔(英语:State of Qatar); }, setTimeoutWidthNum: function (fun, time, number卡塔尔国 { if (fun != null卡塔尔(قطر‎ { setTimeout(function (卡塔尔 { fun(卡塔尔国; number--; if (number > 0卡塔尔(قطر‎ { $.action.setTimeoutWidthNum(fun, time, number卡塔尔; } }, time卡塔尔 } }, //循环实行检查测试成分值是还是不是有值当有值实施回调函数,超时结束检查评定elementValueReady: function (selector, fun, time卡塔尔国 { var selObj = $(selector卡塔尔(英语:State of Qatar); if (time == null卡塔尔(英语:State of Qatar) time = 0; time = time 50; if (time > 5000卡塔尔(英语:State of Qatar) {//间距当先5秒则停止检查测量检验 return; } setTimeout(function (卡塔尔(英语:State of Qatar) { var val = ""; try { val = selObj.val(卡塔尔(英语:State of Qatar); } catch (e卡塔尔(英语:State of Qatar) { } var valIsNull = val == null || val == ""; if (valIsNull卡塔尔(英语:State of Qatar) { $.action.elementValueReady(selector, fun, time卡塔尔国; } else { fun(卡塔尔国; } }, time卡塔尔(قطر‎; }, //循环实行检测选取器的因素假诺存在该因素,则推行回调函数过,超越截至检测elementNullComplate: function (selector, fun, time卡塔尔(英语:State of Qatar) { var selObj = $(selector卡塔尔(قطر‎ if (time == null卡塔尔国 time = 0; time = time 50; if (time > 5000卡塔尔(英语:State of Qatar) {//间距超越5秒则结束检查测量试验 return; } setTimeout(function (卡塔尔国 { if (selObj.size(卡塔尔 > 0卡塔尔 { $.action.elementNullComplate(selector, fun, time); } else { fun(卡塔尔; } }, time卡塔尔; } }, /*日子时间拍卖*/ getdate: { //获取当几天前子 getPresentDate: function (卡塔尔 { var mydate = new Date(卡塔尔; var str = "" mydate.getFullYear(卡塔尔(英语:State of Qatar) "-"; str = (mydate.getMonth(卡塔尔 1卡塔尔(英语:State of Qatar) "-"; str = mydate.getDate(卡塔尔(قطر‎; return str; }, //获取当即日期早先的年月date为日期"二零一四-6",number>0&<四月数 -leo //例:getfirsthalf("二零一五-06",5卡塔尔国 再次来到5个月内的年月数组 getfirsthalf: function (date, number卡塔尔(قطر‎ { var d = new Date(date.replace(/[^d]/g, "/") "/1"); var result = [date]; for (var i = 0; i < number; i 卡塔尔国{ d.setMonth(d.getMonth(卡塔尔(قطر‎ - 1卡塔尔(قطر‎; var m = d.getMonth(卡塔尔国 1; m = m < 10 ? "0" m : m; result.push(d.getFullYear(卡塔尔(英语:State of Qatar) "-" m卡塔尔(英语:State of Qatar); } return result; }, //获取一个月天数 or 最终一天 tpye=Day重临天数 否则赶回最终一天日期-leo getLastDay: function (year, month, dateTpye卡塔尔国 { debugger var new_year = year; //取当前的年份 var new_month = month ;//取下四个月的首后天,方便总结(最终一天不定点) if (month > 12卡塔尔 //假如当前压倒10月,则年度转到本季度 { new_month -= 12; //月份减 new_year ; //年份增 } var new_date = new Date(new_year, new_month 1, 1卡塔尔(قطر‎; //取当年后一个月首的第一天 var date_count = (new Date(new_date.getTime() - 1000 * 60 * 60 * 24卡塔尔卡塔尔国.getDate(卡塔尔;//获取本月的运气 var last_date = new Date(new_date.getTime() - 1000 * 60 * 60 * 24卡塔尔(قطر‎;//获得前一个月最后一天的日期 if (dateTpye == 'dayNum'卡塔尔(英语:State of Qatar) { return date_count; } else { return last_date; } }, //获取七个日子相差天数-leo //计算sDate1 - sDate2 获得相差天数 二零一六-06-18格式 getdatedifference: function (sDate1, sDate2卡塔尔(قطر‎ { var aDate, oDate1, oDate2, iDays aDate = sDate1.split("-"卡塔尔(قطر‎ oDate1 = new Date(aDate[1] '-' aDate[2] '-'

  • aDate[0]) //转换为12-18-2006格式 aDate = sDate2.split("-") oDate2 = new Date(aDate[1] '-' aDate[2] '-' aDate[0]卡塔尔(英语:State of Qatar) iDays = parseInt(Math.abs(oDate1 - oDate2卡塔尔(قطر‎ / 1000 / 60 / 60 / 24)//把相差的飞秒数调换为时局 return iDays }, //相比较四个时间大小 checkEndTime: function (startTime, endTime卡塔尔(英语:State of Qatar) { var starttime = String(startTime卡塔尔(英语:State of Qatar).replace("-", "/"卡塔尔(قطر‎.replace("-", "/"卡塔尔国 var start = new Date(starttime卡塔尔国; var endtime = String(endTime卡塔尔.replace("-", "/"卡塔尔国.replace("-", "/"卡塔尔国 var end = new Date(endtime卡塔尔(قطر‎; if (end < start卡塔尔国{ return "Small"; } else if (end > start卡塔尔 { return "large"; } else { return "equal"; } } }, /*转换*/ convert: { //还原json格式的时光 jsonReductionDate: function (cellval, format卡塔尔(قطر‎ { try { if (cellval == "" || cellval == null卡塔尔国 return ""; var date = new Date(parseInt(cellval.substr(6卡塔尔卡塔尔国卡塔尔国; if (format == null卡塔尔(قطر‎ { var month = date.getMonth(卡塔尔(قطر‎ 1 < 10 ? "0" (date.getMonth(卡塔尔 1卡塔尔(قطر‎ : date.getMonth(卡塔尔(قطر‎ 1; var currentDate = date.getDate(卡塔尔国 < 10 ? "0" date.getDate(卡塔尔(英语:State of Qatar) : date.getDate(卡塔尔(英语:State of Qatar); return date.getFullYear(卡塔尔(قطر‎ "-" month
  • "-" currentDate; } else { return $.convert.toDate(date, format); } } catch (e) { return ""; } }, jsonToStr: function (object) { var type = typeof object; if ('object' == type) { if (Array == object.constructor) type = 'array'; else if (RegExp == object.constructor) type = 'regexp'; else type = 'object'; } switch (type) { case 'undefined': case 'function': case 'unknown': return; break; case 'function': case 'boolean': case 'regexp': return object.toString(); break; case 'number': return isFinite(object) ? object.toString() : 'null'; break; case 'string': return '"' object.replace(/(\|")/g, "\$1").replace(/n|r|t/g, function () { var a = arguments[0]; return (a == 'n') ? '\n' : (a == 'r') ? '\r' : (a == 't') ? '\t' : "" }) '"'; break; case 'object': if (object === null) return 'null'; var results = []; for (var property in object) { var value = jQuery.convert.jsonToStr(object[property]); if (value !== undefined) results.push(jQuery.convert.jsonToStr(property) ':' value); } return '{' results.join(',') '}'; break; case 'array': var results = []; for (var i = 0; i < object.length; i ) { var value = jQuery.convert.jsonToStr(object[i]); if (value !== undefined) results.push(value); } return '[' results.join(',') ']'; break; } }, strToJson: function (str) { return jQuery.parseJSON(str); }, toDate: function (date, format) { var data = new Date(date); var o = { "M ": data.getMonth() 1, //month "d ": data.getDate(), //day "h ": data.getHours(), //hour // "H ": date.getHours(), //hour "m ": data.getMinutes(), //minute "s ": data.getSeconds(), //second "q ": Math.floor((data.getMonth() 3) / 3), //quarter "S": data.getMilliseconds() //millisecond } if (/(y )/.test(format)) format = format.replace(RegExp.$1, (data.getFullYear() "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" k ")").test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" o[k]).substr(("" o[k]卡塔尔(قطر‎.length卡塔尔(英语:State of Qatar)卡塔尔(英语:State of Qatar); return format; }, toInt: function (par卡塔尔(قطر‎ { if (par == null || par == NaN || par == ""卡塔尔国 return 0; return parseInt(par卡塔尔(英语:State of Qatar); }, toNumber: function (obj, pointNum卡塔尔(英语:State of Qatar) { if ($.valiData.isDecimal(obj卡塔尔卡塔尔 { var num = parseFloat(obj卡塔尔国 ""; if (num.lastIndexOf("."卡塔尔国 == -1卡塔尔 { return parseFloat(num卡塔尔国; } else { var index = num.indexOf("."卡塔尔(英语:State of Qatar); var length = num.length; if ((length - index - 1卡塔尔(قطر‎ > pointNum卡塔尔(قطر‎ { return parseFloat(parseFloat(num卡塔尔国.toFixed(pointNum卡塔尔(قطر‎卡塔尔(英语:State of Qatar); } else { return parseFloat(num卡塔尔(英语:State of Qatar); } } } else { return 0; } }, toFloat: function (par卡塔尔国 { if (par == null || par == NaN || par == ""卡塔尔(قطر‎ return 0; return parseFloat(par卡塔尔(英语:State of Qatar); }, xmlToJQuery: function (data卡塔尔国 { var xml; if ($.browser.msie卡塔尔国 {// & parseInt($.browser.version卡塔尔(英语:State of Qatar) < 9 xml = new ActiveXObject("Microsoft.XMLDOM"卡塔尔; xml.async = false; xml.loadXML(data卡塔尔(英语:State of Qatar); // xml = $(xml卡塔尔.children('nodes'卡塔尔(英语:State of Qatar); //这里的nodes为最拔尖的节点 } else { xml = data; } return $(xml卡塔尔(英语:State of Qatar); }, //将标按期期转变届时间格式-leo //day: Thu Aug 22 二零一二 15:12:00 阿奇霉素T 0800 (中华夏族民共和国标定时间卡塔尔 format: yyyy-MM-dd hh:mm:ss standardTimeToDate提姆e: function (day, format卡塔尔国 { var dateTime = new Date(day卡塔尔(قطر‎; var tostr = function (i卡塔尔(英语:State of Qatar) { return (i < 10 ? '0' : ''卡塔尔国
  • i }; return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (item) { switch (item) { case 'yyyy': return tostr(dateTime.getFullYear()); break; case 'MM': return tostr(dateTime.getMonth() 1); break; case 'mm': return tostr(dateTime.getMinutes()); break; case 'dd': return tostr(dateTime.getDate()); break; case 'HH': return tostr(dateTime.getHours()); break; case 'ss': return tostr(dateTime.getSeconds()); break; } }) } }, /*数听新闻表达*/ valiData: { isEmpty: function (val卡塔尔 { return val == undefined || val == null || val == "" || val.toString(卡塔尔 == ""; }, isZero: function (val卡塔尔 { return val == null || val == "" || val == 0 || val == "0"; }, //剖断是或不是为数字 isNumber: function (val卡塔尔(英语:State of Qatar) { return (/^d $/.test(val卡塔尔国卡塔尔(قطر‎; }, //是或不是是邮箱 isMail: function (val卡塔尔国 { return (/^w ([- .]w )*@w ([-.]w )*.w ([-.]w )*$/.test(val卡塔尔(قطر‎卡塔尔; }, //是或不是是手提式有线电话机 isMobilePhone: function (val卡塔尔(قطر‎ { return (/d{11}$/.test(val卡塔尔(英语:State of Qatar)卡塔尔; }, //剖断是还是不是为负数和整数 isNumberOrNegative: function (val卡塔尔(英语:State of Qatar) { return (/^d |计算机网络,-d $/.test(val卡塔尔国卡塔尔国; }, //金额验证 isMoney: function (val卡塔尔(قطر‎ { return (/^[1-9]d*.d*|0.d*[1-9]d*|d $/.test(val)); }, isDecimal: function (val) { return (/^(-?d )(.d )?$/.test(val)); } }, /*项目验证*/ valiType: { isArray: function (obj) { return (typeof obj == 'object') && obj.constructor == Array; }, isString: function (str) { return (typeof str == 'string') && str.constructor == String; }, isDate: function (obj) { return (typeof obj == 'object') && obj.constructor == Date; }, isFunction: function (obj) { return (typeof obj == 'function') && obj.constructor == Function; }, isArrayLike: function (obj) { if (obj == null || isWindow(obj)) { return false; } var length = "length" in Object(obj) && obj.length; if (obj.nodeType === NODE_TYPE_ELEMENT && length) { return true; } return isString(obj) || isArray(obj) || length === 0 || typeof length === 'number' && length > 0 && (length - 1) in obj; }, isObject: function (obj) { return (typeof obj == 'object') && obj.constructor == Object; } }, pageHelper: { referenceFile: function (url, type) { $(function () { var isJs = type == "js"; if (isJs) { var isAny = $("[src='" url "']").size() > 0; if (!isAny) $("head").append("<script src='" url "' /> "); } else { var isAny = $("[href='" url "']").size() > 0; if (!isAny卡塔尔国$("head"卡塔尔.append("<link href='" url "'rel='stylesheet' >"卡塔尔(قطر‎; } }卡塔尔(قطر‎ } }, //定位 position: { //使页面成分上下左右居中 center: function (eleSelector卡塔尔 { var obj = $(eleSelector卡塔尔国; if (obj.size(卡塔尔 > 0卡塔尔国 { obj.each(function (卡塔尔(قطر‎ { var obj = $(this卡塔尔国; var wh = $(window卡塔尔(英语:State of Qatar).height(卡塔尔(英语:State of Qatar); var ww = $(window卡塔尔(قطر‎.width(卡塔尔(قطر‎; var scrh = $(document卡塔尔(قطر‎.scrollTop(卡塔尔; var objh = obj.height(卡塔尔(英语:State of Qatar); var objw = obj.width(卡塔尔国; var top = scrh ((wh - objh卡塔尔(قطر‎ / 2卡塔尔(英语:State of Qatar); var left = ww / 2 - objw / 2; if (scrh > 0卡塔尔(قطر‎ { obj.css({ position: "absolute", left: left, top: top }卡塔尔; } }卡塔尔国 } } }, //ajax扶持 ajaxhelper: { error: function (msg, action卡塔尔国 { if (action != null) { action(msg); } try { console.log(msg); } catch (e) { } } }, /*********************************浏览器操作*********************************/ /*浏览获取操作*/ request: { queryString: function () { var s1; var q = {} var s = document.location.search.substring(1); s = s.split("&"); for (var i = 0, l = s.length; i < l; i ) { s1 = s[i].split("="); if (s1.length > 1) { var t = s1[1].replace(/ /g, " ") try { q[s1[0]] = decodeURIComponent(t) } catch (e) { q[s1[0]] = unescape(t) } } } return q; }, url: function () { return window.location.href; }, urlEncode: function (str) { if (str == null) return ""; var tempstr = str.replace(/ /g, encodeURI("+")); return tempstr; }, domain: function () { return window.location.host; }, pageName: function () { var a = location.href; var b = a.split("/"); var c = b.slice(b.length - 1, b.length).toString(String).split("."); return c.slice(0, 1); }, pageFullName: function () { var strUrl = location.href; var arrUrl = strUrl.split("/"); var strPage = arrUrl[arrUrl.length - 1]; return strPage; }, back: function () { history.go(-1); }, getCookie: function (cookieName) { var cookieValue = document.cookie; var cookieStartAt = cookieValue.indexOf("" cookieName
  • "="); if (cookieStartAt == -1) { cookieStartAt = cookieValue.indexOf(cookieName "="); } if (cookieStartAt == -1) { cookieValue = null; } else { cookieStartAt = cookieValue.indexOf("=", cookieStartAt) 1; cookieEndAt = cookieValue.indexOf(";", cookieStartAt); if (cookieEndAt == -1) { cookieEndAt = cookieValue.length; } cookieValue = unescape(cookieValue.substring(cookieStartAt, cookieEndAt));//解码latin-1 } return cookieValue; }, //打印 print: function (id/*亟需打字与印刷的最外层成分ID*/卡塔尔(英语:State of Qatar) { var el = document.getElementById(id卡塔尔; var iframe = document.createElement('IFRAME'卡塔尔(英语:State of Qatar); var doc = null; iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'卡塔尔(英语:State of Qatar); document.body.appendChild(iframe卡塔尔国; doc = iframe.contentWindow.document; doc.write('<div>' el.innerHTML '</div>'卡塔尔; doc.close(卡塔尔国; iframe.contentWindow.focus(卡塔尔; iframe.contentWindow.print(卡塔尔(英语:State of Qatar); if (navigator.userAgent.indexOf("MSIE"卡塔尔 > 0卡塔尔(英语:State of Qatar) { document.body.removeChild(iframe卡塔尔; } }, //参与收藏夹 addFavorite: function (surl, stitle卡塔尔(قطر‎ { try { window.external.addFavorite(surl, stitle卡塔尔(قطر‎; } catch (e卡塔尔(英语:State of Qatar) { try { window.sidebar.addpanel(stitle, surl, ""卡塔尔; } catch (e卡塔尔 { alert("参预收藏失利,请使用ctrl d举行增添"卡塔尔(قطر‎; } } }, //设为首页 setHome: function (obj, vrl卡塔尔(英语:State of Qatar) { try { obj.style.behavior = 'url(#default#homepage卡塔尔'; obj.sethomepage(vrl卡塔尔; } catch (e卡塔尔(قطر‎ { if (window.netscape卡塔尔(قطر‎ { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"卡塔尔国; } catch (e卡塔尔 { alert("此操作被浏览器推却!n请在浏览器地址栏输入'about:config'并回车n然后将[signed.applets.codebase_principal_support]的值设置为'true',双击就可以。"卡塔尔国; } } else { alert("抱歉,您所接纳的浏览器不可能到位此操作。nn您需求手动设置为首页。"卡塔尔(قطر‎; } } } }, /*浏览器乞求操作*/ response: { setCookie: function (name, value, time) { if (time == null) { time = 30 * 60 * 1000 } //设置名称叫name,值为value的Cookie var expdate = new Date(卡塔尔国; //开首化时间 expdate.setTime(expdate.getTime(卡塔尔(英语:State of Qatar) time卡塔尔国; //时间 document.cookie = name "=" value ";expires=" expdate.to创新霉素TString(卡塔尔国 ";path=/"; //即document.cookie= name "=" value ";path=/"; 时间能够绝不,但路线(path卡塔尔(قطر‎应当要填写,因为JS的暗许路线是当前页,假如不填,此cookie只在这里时此刻页目生效!~ }, open: function (url, params卡塔尔(英语:State of Qatar) { if (params == null || params == ""卡塔尔国 { window.open(url卡塔尔国; } else { if (jQuery.linq.contains(url.toString(卡塔尔(英语:State of Qatar), "?"卡塔尔(英语:State of Qatar)卡塔尔 { var rurl = url "&" jQuery.param(params卡塔尔国; window.open(rurl卡塔尔(英语:State of Qatar); } else { var rurl = url "?" jQuery.param(params卡塔尔国; window.open(rurl卡塔尔(قطر‎; } } }, //页面跳转 redirect: function (url, params卡塔尔(英语:State of Qatar) { if (params == null || params == ""卡塔尔 { window.location.href = url; } else { if (jQuery.linq.contains(url.toString(卡塔尔国, "?"卡塔尔(英语:State of Qatar)卡塔尔(قطر‎ { var rurl = url "&" jQuery.param(params卡塔尔; window.location.href = rurl; } else { var rurl = url "?" jQuery.param(params卡塔尔国; window.location.href = rurl; } } } }, /*浏览器判段*/ broVali: { //jquery1.9以上只要求判段IE isIE: function (卡塔尔(قطر‎ { if (!!window.ActiveXObject || "ActiveXObject" in window卡塔尔国 return true; else return false; }, //老版本jquery用上边的函数 isIE6: function (卡塔尔(قطر‎ { var flag = false; if ($.browser.msie && $.browser.version == "6.0"卡塔尔国flag = true; return flag; }, isIE7: function (卡塔尔(英语:State of Qatar) { var flag = false; if ($.browser.msie && $.browser.version == "7.0"卡塔尔(英语:State of Qatar) flag = true; return flag; }, isIE8: function (卡塔尔国 { var flag = false; if ($.browser.msie && $.browser.version == "8.0"卡塔尔(英语:State of Qatar) flag = true; return flag; }, isIE9: function (卡塔尔(英语:State of Qatar) { var flag = false; if ($.browser.msie && $.browser.version == "9.0")flag = true; return flag; }, isIE10: function (卡塔尔(قطر‎ { var flag = false; if ($.browser.msie && $.browser.version == "10.0"卡塔尔国 flag = true; return flag; }, isIE11: function (卡塔尔国 { var flag = false; if ($.browser.msie && $.browser.version == "11.0"卡塔尔(英语:State of Qatar) flag = true; return flag; }, isMozilla: function (卡塔尔 { var flag = false; if ($.browser.mozilla卡塔尔(قطر‎ flag = true; return flag; }, isOpera: function (卡塔尔(英语:State of Qatar) { var flag = false; if ($.browser.opera卡塔尔 flag = true; return flag; }, isSafri: function (卡塔尔国 { var flag = false; if ($.browser.safari卡塔尔 flag = true; return flag; }, isMobile: function (卡塔尔 { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "金立", "SymbianOS", "Windows Phone", "GALAXY Tab", "iPod"卡塔尔(قطر‎; var flag = false; for (var v = 0; v < Agents.length; v 卡塔尔国 { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = true; break; } } return flag; }, isIPhone: function () { var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); return jQuery.jQueryAny(Agents, function (v) { return v == "iPhone"; }); }, isAndroid: function () { var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); return jQuery.jQueryAny(Agents, function (v) { return v == "Android"; }); } } }); /*********************************模板拆解解析引擎 by 二零一五-8-2*****************/ $(function (卡塔尔(英语:State of Qatar) { //通用正则 var FN_ARGS = /^functions*[^(]*(s*([^)]*))/m; var FN_ARG_SPLIT = /,/; var FN_ARG = /^s*(_?)(S ?)1s*$/; var STRIP_COMMENTS = /((//.*$)|(/*[sS]*?*/))/mg; window.$ejqApp = {}; $ejqApp.apps = []; function setModule(fn, ctr) { var pars = []; var fnText = fn.toString().replace(STRIP_COMMENTS, ''); argDecl = fnText.match(FN_ARGS); forEach(argDecl[1].split(FN_ARG_SPLIT), function (arg) { arg.replace(FN_ARG, function (all, underscore, name) { pars.push({ name: name }); }); }); var queueItem = { controller: ctr, pars: pars }; return queueItem; } $ejqApp.module = function (app, obj) { var apps = $.linq.where($ejqApp.apps, function (v) { return v.appName == app }); var isAny = apps != null && apps.length > 0; if (isAny) { return apps[0]; } else { var reval = { appName: app, templateHtml: $("[ ng-app="" app ""]").html(), getObj: function () { return $("[ ng-app="" app ""]") }, controller: function (ctr, obj) { var th = this; var app = this.getObj(); var ctrObj = app.find("[ng-controller='" ctr "']"); var queueItem = setModule(obj, ctrObj); $.each(queueItem.pars, function (i, v) { if (v.name == "$con") { v.getObj = function () { return th.getObj().find("[ng-controller='" ctr "']"); }; } if (v.name == "$app") { v.getObj = function (selector) { return th.getObj(); } } if (v.name == "$tool") { v.method = {} } if (v.name == "$event") { v.getObj = function (selector) { return th.getObj(); } } }) obj.apply(new function () { }, queueItem.pars); queueItem.name = ctr; this.controllerParas = { pars: queueItem }; } }; $ejqApp.apps.push(reval); return reval; } } $ejqApp.apps.bind = function () { $($ejqApp.apps).each(function (i, v) { var appObj = v.getObj(); appObj.html(v.templateHtml); var th = v; $.each(v.controllerParas, function (i, pars) { var obj = appObj.find("[ng-controller='" pars.name "']"); $.each(pars.pars, function (i, par) { switch (par.name) { case "$scope": $scope(obj, par); break; case "$http": $http(obj, par); break; } }) }) }) } function $scope(obj, par) { var kvs = $.action.jsonDictionary(par) $.each(kvs, function (i, v) { if (v.key == "name") return; var isArray = $.valiType.isArray(v); if (isArray) { resolveArray(v.key, obj, v.value) } else { resolveJson(v.key, obj, v.value) } }) } function $http(obj, par) { var kvs = $.action.jsonDictionary(par) var kv = $.linq.single(kvs, function (v) { return $.valiType.isObject(v.value); }); if (kv == null) return; var ajaxSetting = kv.value; if (ajaxSetting != null) { if (ajaxSetting.cache == null) { ajaxSetting.cache = false; } $.ajax({ url: ajaxSetting.url, cache: ajaxSetting.cache, dataType: "json", type: ajaxSetting.type, success: function (msg) { var isArray = $.valiType.isArray(msg); if (isArray) { resolveArray(kv.key, obj, msg) } else { resolveJson(kv.key, obj, msg) } if (ajaxSetting.success != null) { ajaxSetting.success(msg); } }, error: function (msg) { if (ajaxSetting.error != null) { ajaxSetting.error(msg); } } }); } } function resolveJson(name, obj, json, prefix) { if (prefix == null) prefix = ""; var kvs = $.action.jsonDictionary(json) var dataHtml = obj.data("myng-html"); var innerHtml = obj.html(); if (dataHtml == null) { innerHtml = obj.html(); } else { innerHtml = dataHtml; } var funs = []; if (innerHtml != null && innerHtml != "") { $.each(kvs, function (i, v) { var isArray = $.valiType.isArray(v.value); if (isArray) { funs.push({ name: v.key, obj: obj, value: v.value, prefix: name }); } else { innerHtml = innerHtml.replace(new RegExp("{{" prefix name "." v.key "}}"), v.value); } }) obj.html(innerHtml); obj.data("myng-html", innerHtml); $.each(funs, function (i, v) { resolveArray(v.name, v.obj, v.value, v.prefix); }) } } function resolveArray(name, obj, json, prefix) { obj.find("[ng-repeat]").each(function () { var th = $(this); var innerTemplate = th.html(); var repeatValue = th.attr("ng-repeat"); prefix = prefix == null ? "" : prefix; var reg = new RegExp("([a-z,A-Z][0-9,a-z,A-Z]*)\s in\s " prefix "." name); if (reg.test(repeatValue)) { th.html(""); var itemName = repeatValue.match(reg)[1]; $.each(json, function (i, jsonItem) { var kvs = $.action.jsonDictionary(jsonItem) var appendItem = innerTemplate; $.each(kvs, function (i, v) { var isArray = $.valiType.isArray(v.value); if (isArray) { debugger resolveArray(v.key, obj, v.value, name); } else { appendItem = appendItem.replace(new RegExp("{{" itemName "."
  • v.key "}}"), v.value); } }) th.append(appendItem); }); } }) var dataHtml = obj.data("myng-html", obj.html()); } function forEach(obj, iterator, context) { var key, length; if (obj) { if ($.valiType.isFunction(obj)) { for (key in obj) { if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) { iterator.call(context, obj[key], key, obj); } } } else if ($.valiType.isArray(obj) || $.valiType.isArrayLike(obj)) { var isPrimitive = typeof obj !== 'object'; for (key = 0, length = obj.length; key < length; key ) { if (isPrimitive || key in obj) { iterator.call(context, obj[key], key, obj); } } } else if (obj.forEach && obj.forEach !== forEach) { obj.forEach(iterator, context, obj); } else if (isBlankObject(obj)) { for (key in obj) { iterator.call(context, obj[key], key, obj); } } else if (typeof obj.hasOwnProperty === 'function') { for (key in obj) { if (obj.hasOwnProperty(key)) { iterator.call(context, obj[key], key, obj); } } } else { for (key in obj) { if (hasOwnProperty.call(obj, key)) { iterator.call(context, obj[key], key, obj); } } } } return obj; } }) /*********************************form操作*********************************/ jQuery.fn.extend({ //获取成分属性以","隔离 attrToStr: function (attr卡塔尔国 { var reval = ""; this.each(function (卡塔尔国 { reval = jQuery(this卡塔尔(قطر‎.attr(attr卡塔尔国
  • "," }卡塔尔 reval = jQuery.jQueryAction.trimEnd(reval, ","卡塔尔(英语:State of Qatar); return reval; }, //清空表单 formClear: function (卡塔尔国 { this.find("input:text,select,input:hidden,input:password"卡塔尔国.each(function (卡塔尔 { $(this卡塔尔.val(""卡塔尔国; }卡塔尔; this.find("input:checkbox,input:radio"卡塔尔.each(function (卡塔尔 { $(this卡塔尔.removeAttr("checked"卡塔尔国; }卡塔尔; }, //将json对象活动填充到表单 //举例$('form'卡塔尔.formFill({data:{id:1},prefix:"user."}卡塔尔国 填充后 <input name='user.id' value='1' > formFill: function (option卡塔尔国 { var prefix = option.prefix; if (prefix == undefined卡塔尔(英语:State of Qatar) prefix = ""; var frmData = option.data; for (i in frmData卡塔尔国 { var dataKey = i; var thisData = this.find("[name='" prefix i "']"); var text = "text"; var hidden = "hidden"; if (thisData != null) { var thisDataType = thisData.attr("type"); var val = frmData[i]; var isdata = (val != null && val.toString().lastIndexOf("/Date(") != -1); if (thisDataType == "radio") { thisData.filter("[value=" val "]").attr("checked", "checked") if (val == true || val == "0") val = "True"; else if (val == false || val != "0") val = "False"; thisData.filter("[value=" val "]").not("donbool").attr("checked", "checked") } else if (thisDataType == "checkbox") { if (thisData.size() == 1) { if (val == "true" || val == 1 || val == "True" || val == "1") { thisData.attr("checked", "checked"); } else { thisData.removeAttr("checked"); } } else { thisData.removeAttr("checked"); var cbIndex = i; if (val.lastIndexOf(",") == -1) { this.find("[name='" prefix dataKey "'][value='" prefix val "']").attr("checked", "checked"); } else { jQuery(val.split(',')).each(function (i, v) { this.find("[name='" prefix dataKey "'][value='" prefix v "']").attr("checked", "checked");; }) } } } else { if (isdata) { val = jQuery.Convert.jsonReductionDate(val); } if (val == "null" || val == null) val = ""; if (val == "" && thisData.attr("watertitle") == thisData.val()) { } else { thisData.val(val ""); thisData.removeClass("watertitle") } } } } } }); /*********************************通用属性扩张*****************************/ jQuery.ejqInit = function () { String.prototype.ejq_format = function (args) { var _dic = typeof args === "object" ? args : arguments; var reval = this.replace(/{([^{}] )}/g, function (str, key) { return _dic[key]; }); return reval; } String.prototype.ejq_append = function (args) { return this args; } String.prototype.ejq_appendFormat = function (appendValue, appendArgs) { return this appendValue.ejq_format(appendArgs); } String.prototype.ejq_selector = function (args) { return $(this); } String.prototype.ejq_toFixed = Number.prototype.ejq_toFixed = function (d) { var s = this ""; if (!d) d = 0; if (s.indexOf(".") == -1) s = "."; s = new Array(d 1).join("0"); if (new RegExp("^(-|\ )?(\d (\.\d{0," (d 1) "})?)\d*$").test(s)) { var s = "0" RegExp.$2, pm = RegExp.$1, a = RegExp.$3.length, b = true; if (a == d 2) { a = s.match(/d/g); if (parseInt(a[a.length - 1]) > 4) { for (var i = a.length - 2; i >= 0; i--) { a[i] = parseInt(a[i]) 1; if (a[i] == 10) { a[i] = 0; b = i != 1; } else break; } } s = a.join("").replace(new RegExp("(\d )(\d{" d "})\d$"), "$1.$2"); } if (b) s = s.substr(1); return (pm s).replace(/.$/, ""); } return this ""; }; } jQuery.ejqInit(); })(window, jQuery) ejq.js

 

var objNameTop = objName.substr(0,objName.indexOf;

给个赞哈

 

id = objName;

技术群 225982985 群里有大气上档期的顺序IT男,迎接大量表姐出席

 

简要介绍ejq是黄金时代款极其精细的JS工具库,未压缩才50K,在jquery的底子上对jq...

var loadVUD = UserData.load;

if (loadVUD == null || loadVUD == undefined || loadVUD == '') {

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]] ;

}

break;

case 'PP':

valueUD = obj.id;

var objName = obj.name;

var objNameTop = objName.substr(0,objName.indexOf;

id = objName;

var loadVUD = UserData.load;

if (loadVUD == null || loadVUD == undefined || loadVUD == '') {

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]] ;

}

break;

case 'text':

valueUD = obj.value;

id = "text_" obj.id;

var loadVUD = UserData.load;

if {

if (valueUD == null || valueUD == '') {

return;

}

else {

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]] ;

}

}

else {

if (valueUD == null || valueUD == '') {

UserData.remove;

examAnswerKeyStr = removeStrWithcomma;

UserData.save(examinfo, "examAnswerKeyStr", examAnswerKeyStr, 1);

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]]--;

return;

}

}

break;

case 'checkbox':

id = "checkbox_" obj.id.substr(0, obj.id.lastIndexOf;

var key = obj.id.substr(0, obj.id.lastIndexOf;

key = "checkbox_" key;

valueUD = UserData.load;

var flag = obj.checked;

if {

if {

id = key;

valueUD = obj.id;

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]] ;

}

}

else {

if {

if (valueUD.indexOf {

valueUD = "," obj.id

}

}

else {

if (valueUD.indexOf {

if (valueUD.indexOf {

valueUD = valueUD.replace;

}

else

if (valueUD.indexOf {

valueUD = valueUD.replace;

}

else {

UserData.remove;

examAnswerKeyStr = removeStrWithcomma(examAnswerKeyStr, key);

UserData.save(examinfo, "examAnswerKeyStr", examAnswerKeyStr, 1);

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]]--;

return;

}

}

}

}

break;

case 'textarea':

valueUD = obj.value;

id = "textarea_" obj.id;

var loadVUD = UserData.load;

if {

if (valueUD == null || valueUD == '') {

return;

}

else {

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]] ;

}

}

else {

if (valueUD == null || valueUD == '') {

UserData.remove;

examAnswerKeyStr = removeStrWithcomma;

UserData.save(examinfo, "examAnswerKeyStr", examAnswerKeyStr, 1);

var tmpTGId = obj.id.substr(0, obj.id.indexOf;

qNoTotalD[qIdNoStr[tmpTGId]]--;

return;

}

}

break;

default:

return; }

编辑:计算机网络 本文来源:功能齐全并且比较时髦的Jquery通用开源框架之,

关键词: 亚洲城ca88