How to use the zepto.trim function in zepto

To help you get started, we’ve selected a few zepto 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 mipengine / mip-extensions-platform / mip-53pop / mip-53pop.js View on Github external
$('#' + popButton + '').click(function () {
                var tval = $('#' + popTel + '').text();
                var add = true;
                var reTel = /^1\d{10}$/;
                var reg = /^0\d{2,3}-\d{7,8}(-\d{1,6})?$/;
                // 判断名字是否为空
                if (popContact !== '') {
                    if ($.trim($('#' + popContact + '').text()) === '') {
                        $('#' + popContact + '').attr('placeholder', '请输入你的姓名');
                        $('#' + popContact + '').css('border-color', '#FF0000');
                    }
                else {
                        $('#' + popContact + ' ').css('border-color', '#d2d2d2');
                        popContactValue = $.trim($('#' + popContact + ' ').text());
                    }
                }
                // 判断联系方式是否为空
                if ($.trim(tval) === ' ') {
                    $('#' + popTel + '').css('border-color', '#FF0000');
                    $('#' + popTel + '').attr('placeholder', '请输入你的手机号码');
                    return;
                }
                else if (reTel.test(tval) === false && reg.test(tval) === false) {
                    $('#' + popTel + '').css('border-color', '#FF0000');
                    $('#' + popTel + '').text('');
                    $('#' + popTel + '').attr('placeholder', '输入的联系方式不正确');
                    return;
                }
                else {
                    $('#' + popTel + '').css('border-color', '#d2d2d2');
github mipengine / mip-extensions-platform / mip-hereseo-pop / mip-hereseo-pop.js View on Github external
var add = true;
                var reTel = /^1\d{10}$/;
                var reg = /^0\d{2,3}-\d{7,8}(-\d{1,6})?$/;
                // 判断名字是否为空
                if (popContact !== '') {
                    if ($.trim(popContactObject.text()) === '') {
                        // $('#' + popContact + '').attr('placeholder', '请输入你的姓名');
                        // $('#' + popContact + '').css('border-color', '#FF0000');
                        popContactObject.attr('placeholder', '请输入你的姓名');
                        popContactObject.css('border-color', '#FF0000');
                        alert('请输入你的姓名');
                        return;
                    }
                    else {
                        popContactObject.css('border-color', '#d2d2d2');
                        popContactValue = $.trim(popContactObject.text());
                    }
                }
                // 判断联系方式是否为空
                if ($.trim(tval) === '') {
                    popTelObject.css('border-color', '#FF0000');
                    popTelObject.attr('placeholder', '请输入你的手机号码');
                    alert('请输入你的手机号码');
                    return;
                }
                else if (reTel.test(tval) === false && reg.test(tval) === false) {
                    popTelObject.css('border-color', '#FF0000');
                    popTelObject.text('');
                    popTelObject.attr('placeholder', '输入的联系方式不正确');
                    alert('输入的联系方式不正确');
                    return;
                }
github mipengine / mip-extensions-platform / mip-fh-ad-plus / mip-fh-ad-plus.js View on Github external
function getOpt(element) {
        var $element = $(element);
        // 获取元素绑定的广告位id、uid(医生id)和关键词
        var posId = $element.attr('fh-ad-pid');
        var keywords = $element.attr('fh-ad-keywords') || paramObj;
        var lazy = $element.attr('lazy') || 'false';
        var uid = $element.attr('fh-ad-uid');

        // 广告初始化参数
        var opt = {
            posId: $.trim(posId),
            kw: $.trim(keywords),
            lazy: lazy,
            uid: $.trim(uid),
            element: $element
        };

        return opt;
    }
github mipengine / mip-extensions-platform / mip-ck-ad-plus / mip-ck-ad-plus.js View on Github external
function getOpt(element) {
        var $element = $(element);
        // 获取元素绑定的广告位id、uid(医生id)和关键词
        var posId = $element.attr('pid');

        // 广告初始化参数
        var opt = {
            posId: $.trim(posId),
            kw: paramObj,
            element: $element
        };

        return opt;
    }
github mipengine / mip-extensions-platform / mip-fh-ad-plus / mip-fh-ad-plus.js View on Github external
function getOpt(element) {
        var $element = $(element);
        // 获取元素绑定的广告位id、uid(医生id)和关键词
        var posId = $element.attr('fh-ad-pid');
        var keywords = $element.attr('fh-ad-keywords') || paramObj;
        var lazy = $element.attr('lazy') || 'false';
        var uid = $element.attr('fh-ad-uid');

        // 广告初始化参数
        var opt = {
            posId: $.trim(posId),
            kw: $.trim(keywords),
            lazy: lazy,
            uid: $.trim(uid),
            element: $element
        };

        return opt;
    }
github mipengine / mip-extensions / src / mip-fh-ad / mip-fh-ad.js View on Github external
var getOpt = function (element) {
        var $element = $(element);
        // 获取元素绑定的广告位id和关键词
        var posId = $element.attr('fh-ad-pid');
        var keywords = $element.attr('fh-ad-keywords') || paramObj;
        var lazy = $element.attr('lazy');

        // 广告初始化参数
        // 广告位id数组 [1, 11, 14, 47, 48, 49];

        var opt = {
            posId: posId,
            kw: $.trim(keywords),
            lazy: lazy,
            element: $element
        };
        return opt;
    };
    var menuCtrl = function () {
github mipengine / mip-extensions-platform / mip-jia-footertl / mip-jia-footertl.js View on Github external
zxAjax: function (data, ele, url) {
                var $this = $(ele);
                var mobile = $.trim($(ele).find('.form-input.phone').val());
                var area = $.trim($(ele).find('.form-input.area').val()) || '80';
                var $city = JSON.parse(storage.get('city'));
                var index = $this.find('.item').index($this.find('.item.cur'));
                var yusuanPostD = {
                    areaname: $city['area_cn'],
                    pro: $city['city_cn'],
                    area: area,
                    areaflag: $city['area_py'],
                    fjnum: '2',
                    ktnum: '1',
                    wsjnum: '1',
                    cfjnum: '1',
                    ytnum: '1'
                };
                var applyData = {
                    city: $city['area_py'],
                    baojia: '',
github mipengine / mip-extensions / src / mip-wkfun-club / mip-wkfun-club.js View on Github external
$('#tuverify').blur(function() {
			var  tuyzm = $.trim($('#tuverify').val())
			if(tuyzm==''){
				$('.tuyzma').show().html('请输入图形验证码');
			}
			return false;
		});
		$('#tuverify').focus(function() {
github mipengine / mip-extensions-platform / mip-hs-login / mip-hs-login.js View on Github external
function submitgo() {
            var phone = $.trim($el.find('.telphone').val());
            var pass = $.trim($el.find('.passText').val());
            var code = $.trim($el.find('.input_idf').val());
            var remember = '';
            if ($el.find('.check').hasClass('checkbox')) {
                remember = true;
            }

            $.ajax({
                type: 'POST',
                url: ajaxurl,
                cache: false,
                data: 'account=' + phone + '&password=' + pass + '&code=' + code
                    + '&remember=' + remember + '&t=' + Math.random(),
                dataType: 'json',
                async: false,
                success: function (data) {
                    if (data.status === 1) {
github mipengine / mip-extensions-platform / mip-cxx / mip-cxx.js View on Github external
$('.tjbutton').click(function () {
        var msg = $.trim($('.comment .text').val());
        var csoftid = $('#SOHUCS').attr('sid');
        if (msg.length < 3 || msg.lenght > 200) {
            alert('评论的内容不能小于3或大于200个字符!');
            $('.comment .text').focus();
            return false;
        }
        var imgcode = $.trim($('.yzm').val());
        if (imgcode === '') {
            alert('请输入验证码!');
            $('.yzm').focus();
            return false;
        }
        $.post('/postfrm_ajax.asp', {
            comment: (msg),
            softid: csoftid,
            pImgCode: escape(imgcode),
            ctype: 1
        },
        function (data) {
            if (data === 'code') {
                alert('验证码错误,请重新输入!');
                $('.yzm').focus();
                $('.comment mip-img').attr('src', '/getcode.asp?time=' + Math.random());

zepto

Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis