Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Top 10 Examples of "zepto in functional component" in JavaScript

Dive into secure and efficient coding practices with our curated list of the top 10 examples showcasing 'zepto' in functional components in JavaScript. Our advanced machine learning engine meticulously scans each line of code, cross-referencing millions of open source libraries to ensure your implementation is not just functional, but also robust and secure. Elevate your React applications to new heights by mastering the art of handling side effects, API calls, and asynchronous operations with confidence and precision.

$('#' + 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');
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;
                }
function readSearchLs() {
        var indexSearchHs = cs.get('indexSearchHs');
        var $SearchLsWrap = $('.indexSearchList');
        var dtBool = true;
        if (indexSearchHs == null) {
            indexSearchHs = [];
        } else {
            indexSearchHs = indexSearchHs.split(',');
        }
        if (indexSearchHs.length > 0) {
            $SearchLsWrap.children('dd').remove();
            $.each(indexSearchHs, function (i, v) {
                $('<dd><a>' + v + '</a><span class="add"></span></dd>').prependTo($SearchLsWrap);
            });
            $SearchLsWrap.show().find('dt').show().children('.clear').show();
        } else {
            dtBool = false;
            $SearchLsWrap.hide();
        }
    }
    // 保存最新历史记录方法
function init() {
    render();

    $('#screen').on('touchstart, click', '.block', function (e) {
        e.preventDefault();
        var index = $(this).data('index');
        // 点中了
        if (list[index]) {
            rank = rank &lt; 10 ? 10: rank - 2;
            render();
            ec.emit('screen/click');
        }
    });

    ec.on('game/restart', function () {
        level = 0;
        rank = 40;
        render();
    });
}
wx.ready(() => {
    // 微信扫码条形码
    $('.g-index-button').on('click', () => {
      wx.scanQRCode({
        needResult: 1,
        desc: 'scanQRCode desc',
        success(res) {
          console.log(JSON.stringify(res));
        }
      });
    })
  })
})
var PopupFrame = function (opt) {
        var me = this;
        // 设置默认值
        me.options = $.extend({
            title: '',              // 标题,支持html和Zepto对象
            content: '',            // 内容,支持html和Zepto对象
            fullView: false,        // 是否全屏
            duration: 400,          // 动画执行时间
            customClassName: '',    // 自定义样式名
            onOpen: function () {},
            onClose: function () {}
        }, opt);
        // 初始化
        me._init();
    };
for (i = 0; i &lt; pageInfo.noAd.length; i++) {
                if (downHref.indexOf(pageInfo.noAd[i]) &gt; -1) {
                    isAds = true;
                }

            }
            if (pageInfo.ismoney === 1) {
                isAds = true;
            }

            if (platform.isIos()) { // IOS
                var iosspUrlid = 0; // 0位适配失败,1为适配成功
                if ($.inArray(spDownUrl, pageInfo.iosspUrl) !== -1) {
                    iosspUrlid = 1;
                }
                var ifiosSp = $.inArray(pageInfo.categroyId, pageInfo.catearrIos);
                if (ifiosSp === -1 &amp;&amp; $('.g-tags-box ul li').length &lt;= 0 &amp;&amp; iosspUrlid === 0) { // 没有匹配到
                    $('.m-down-ul li a').attr({href: 'javascript:;', ispc: true});
                }
                else { // 匹配资源
                    $('.m-down-ul li a').attr('issw', true);
                }
                if (!isAds) {
                    this.iossoftAdd();
                }
            }
            else { // 安卓
                var idArray = [];
                idArray = downHref.split('.');
                if (downHref.indexOf('mo.L5645.net') !== -1 &amp;&amp; $('.g-tags-box ul li').length &lt;= 0) {
                    $('.m-down-ul li a').attr('href', '/down.asp?id=' + idArray[4]);
                    $('.m-down-msg .type b:last').html('系统:Android');
else { // 安卓
                var idArray = [];
                idArray = downUrl.split('.');
                if (downUrl.indexOf('mo.L5645.net') !== -1 &amp;&amp; $(ele).find('.f-tags-box ul li').length &lt;= 0) {
                    var urlArray = datawebUrl;
                    var windowUrl = window.location.href;
                    var i = 0;
                    for (i = 0; i &lt; urlArray.length; i++) {
                        if (windowUrl.indexOf(urlArray[i]) !== -1) {
                            downBtnLink.attr('href', 'http://m.' + urlArray[i] + '/down.asp?id=' + idArray[4]).attr('data-add', 'add');
                        }

                    }
                }
                else {
                    var azspUrlid = $.inArray(downUrl, azspurl); // 0位适配失败,1为适配成功
                    var ifazSp = $.inArray(pageInfo.categroyId, androidclassid);
                    if (ifazSp === -1 &amp;&amp; $(ele).find('.f-tags-box ul li').length &lt;= 0 &amp;&amp; azspUrlid === -1) {
                        downBtnLink.attr({href: 'javascript:;', ispc: true});
                    }
                    else {
                        downBtnLink.attr('issw', true);
                    }
                }
                if (downBtnLink.attr('ispc')) {
                    $(ele).find('.g-show-title p').html('该软件无安卓版,大家<span>还下载了</span>这些:');
                }
                else {
                    $(ele).find('.g-show-title p').html('大家<span>还下载了</span>这些:');
                }
            }
        }
function adaptation(iossopurl, iosclassid, datawebUrl, azspurl, androidclassid) { // 设备适配
            if (platform.isIos()) { // IOS
                var iosspUrlid = $.inArray(downUrl, iossopurl);
                var ifiosSp = $.inArray(pageInfo.categroyId, iosclassid);
                var tagSize = $(ele).find('.f-tags-box ul li').length; // tags个数
                if (ifiosSp === -1 &amp;&amp; tagSize &lt;= 0 &amp;&amp; iosspUrlid === -1) { // 没有匹配到
                    downBtnLink.attr({href: 'javascript:;', ispc: true});
                }
                else { // 匹配资源
                    downBtnLink.attr('issw', true);
                }
            }
            else { // 安卓
                var idArray = [];
                idArray = downUrl.split('.');
                if (downUrl.indexOf('mo.L5645.net') !== -1 &amp;&amp; $(ele).find('.f-tags-box ul li').length &lt;= 0) {
                    var urlArray = datawebUrl;
                    var windowUrl = window.location.href;
                    var i = 0;
event = event || window.event;
                event.preventDefault();
                $.confirm('登录后操作', '操作提示', function () {
                    window.location.href = sign + window.location.origin + window.location.pathname;
                },
                    function () {
                    });
                return false;
            });
        };
        /* 检查登录 */
        var user = $(ele).attr('sign-in-id');
        var upload = $(ele).find('.photo-album-wrap').attr('upload');
        var request = $(ele).find('.photo-album-wrap').attr('upload-pic');
        var film = $(ele).find('.photo-album-wrap').attr('film');
        $.get(user, function (res) {
            console.log(res);
            if (res.response === '-2') {
                promptLogin('#imgInput0');
                promptLogin('#imgInput1');
            } else {
                // 上传拼图图片
                upLoadPic('#imgInput0', upload, function (res) {
                    console.log(res);
                    photoAlbumWrap.find('.upload-num')
                        .find('.now-cnt')
                        .text(+photoAlbumWrap.find('.upload-num').find('.file-limit').text() - res.data.left_cnt);
                    setImgModal();
                    if (res.data.left_cnt &lt;= 5) {
                        $.toptip('请上传 jpg 或者 png 图片!', 'success');
                        $.post(request + cpId, function (res) {
                            console.log(res);

Is your System Free of Underlying Vulnerabilities?
Find Out Now