How to use the spm-jquery.trim function in spm-jquery

To help you get started, we’ve selected a few spm-jquery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aralejs / validator / src / item.js View on Github external
getter: function(val){
                val = $.trim(val);

                // 在获取的时候动态判断是否required,来追加或者删除 rule: required
                if (this.get('required')) {
                    if (!val || !hasRequired(val)) {
                        val = $.trim('required ' + val);
                    }
                } else {
                    if (hasRequired(val)) {
                        val = $.trim((' ' + val + ' ').replace(' required ', ' '));
                    }
                }

                return val;
            }
        },
github aralejs / validator / src / item.js View on Github external
getter: function(val){
                val = $.trim(val);

                // 在获取的时候动态判断是否required,来追加或者删除 rule: required
                if (this.get('required')) {
                    if (!val || !hasRequired(val)) {
                        val = $.trim('required ' + val);
                    }
                } else {
                    if (hasRequired(val)) {
                        val = $.trim((' ' + val + ' ').replace(' required ', ' '));
                    }
                }

                return val;
            }
        },
github aralejs / validator / src / item.js View on Github external
getter: function(val){
                val = $.trim(val);

                // 在获取的时候动态判断是否required,来追加或者删除 rule: required
                if (this.get('required')) {
                    if (!val || !hasRequired(val)) {
                        val = $.trim('required ' + val);
                    }
                } else {
                    if (hasRequired(val)) {
                        val = $.trim((' ' + val + ' ').replace(' required ', ' '));
                    }
                }

                return val;
            }
        },
github aralejs / validator / src / utils.js View on Github external
$.each(arr, function (i, v) {
        arr[i] = $.trim(v);
        if (!arr[i])
            throw new Error(NOTICE);

        var arr2 = arr[i].split(':');

        var key = $.trim(arr2[0]),
            value = $.trim(arr2[1]);

        if (!key || !value)
            throw new Error(NOTICE);

        result[getValue(key)] = $.trim(getValue(value));
    });
github aralejs / validator / src / utils.js View on Github external
$.each(arr, function (i, v) {
        arr[i] = $.trim(v);
        if (!arr[i])
            throw new Error(NOTICE);

        var arr2 = arr[i].split(':');

        var key = $.trim(arr2[0]),
            value = $.trim(arr2[1]);

        if (!key || !value)
            throw new Error(NOTICE);

        result[getValue(key)] = $.trim(getValue(value));
    });
github aralejs / validator / src / utils.js View on Github external
$.each(arr, function (i, v) {
        arr[i] = $.trim(v);
        if (!arr[i])
            throw new Error(NOTICE);

        var arr2 = arr[i].split(':');

        var key = $.trim(arr2[0]),
            value = $.trim(arr2[1]);

        if (!key || !value)
            throw new Error(NOTICE);

        result[getValue(key)] = $.trim(getValue(value));
    });
github aralejs / validator / src / utils.js View on Github external
$.each(arr, function (i, v) {
        arr[i] = $.trim(v);
        if (!arr[i])
            throw new Error(NOTICE);

        var arr2 = arr[i].split(':');

        var key = $.trim(arr2[0]),
            value = $.trim(arr2[1]);

        if (!key || !value)
            throw new Error(NOTICE);

        result[getValue(key)] = $.trim(getValue(value));
    });
github aralejs / validator / src / rule.js View on Github external
var element = $(options.element);

    var t = element.attr('type');
    switch (t) {
        case 'checkbox':
        case 'radio':
            var checked = false;
            element.each(function (i, item) {
                if ($(item).prop('checked')) {
                    checked = true;
                    return false;
                }
            });
            return checked;
        default:
            return Boolean($.trim(element.val()));
    }
}, '请输入{{display}}');
github aralejs / validator / src / rule.js View on Github external
arr && $.each(arr, function (i, v) {
        var key = v.match(regexp2)[1];
        var value = obj[$.trim(key)];
        result = result.replace(v, value);
    });
    return result;

spm-jquery

JavaScript library for DOM operations

MIT
Latest version published 9 years ago

Package Health Score

69 / 100
Full package analysis