How to use the zepto.isPlainObject 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-ck-ad-plus / mip-ck-ad-plus.js View on Github external
// 设置配置项默认值
        var posId = [opt.posId] || [1];
        var kw = opt.kw || '';
        var element = opt.element;
        var $plus = $('mip-ck-ad-plus');
        var ckAdPutNum = $plus.length;
        var ckAdNum = $body.attr('ck-ad-num') || 0;

        // 接口参数值
        var query = {
            kw: kw,
            pid: posId.join(',')
        };

        // 如果adData不是一个Object,强制转为{}
        if (!(adData && $.isPlainObject(adData))) {
            adData = {};
        }

        query = $.extend(adData, query);

        query.pid = getPids($plus).join(',');

        $body.attr('ck-ad-num', ++ckAdNum);

        var ckAdOpt = {
            adUrl: adUrl,
            query: query,
            element: element
        };

        // 广告组件数量 不等于 已经渲染的广告组件数量 直接退出 不请求接口
github mipengine / mip-extensions-platform / mip-ck-ad-plus / mip-ck-ad-plus.js View on Github external
$.each(data, function (k, v) {

            // 获取投放直销广告的节点
            element = $('mip-ck-ad-plus[pid="' + k + '"]');
            uid = element.attr('ck-ad-uid');

            // 根据医生id判断物料类型
            v = (query.uid && $.isPlainObject(v)) ? v[uid] : v;

            // 有特定广告位id的直投广告 先隐藏网盟 再显示直投
            if ($.trim(v)) {
                element.children(':first-child').remove();
                element.html(v);

                $body.addClass('view-ck-ad-' + (+k));

                isHasCkAd = true;
            }
            // 无特定广告位id直投广告显示网盟
            else {
                element.children(':first-child').show();

                $body.addClass('view-ck-ad-' + (+k) + '-union');
            }
github mipengine / mip-extensions-platform / mip-fh-ad-plus / mip-fh-ad-plus.js View on Github external
$.each(data, function (k, v) {

                // 获取投放直销广告的节点
                element = $('mip-fh-ad-plus[fh-ad-pid="' + k + '"]');
                uid = element.attr('fh-ad-uid');

                // 根据医生id判断物料类型
                v = (query.uid && $.isPlainObject(v)) ? v[uid] : v;

                // 有特定广告位id的直投广告 先隐藏网盟 再显示直投
                if ($.trim(v)) {
                    element.children(':first-child').remove();
                    element.html(v);

                    $body.addClass('view-fh-ad-' + (+k));

                    isHasFhAd = true;
                }
                // 无特定广告位id直投广告显示网盟
                else {
                    element.children(':first-child').show();

                    $body.addClass('view-fh-ad-' + (+k) + '-union');
                }
github mipengine / mip-extensions-platform / mip-fh-zhida-plus / mip-fh-zhida-plus.js View on Github external
$.each(data, function (k, v) {

                // 获取投放直销广告的节点
                element = $('mip-fh-zhida-plus[fh-ad-pid="' + k + '"]');
                uid = element.attr('fh-ad-uid');

                // 根据医生id判断物料类型
                v = (query.uid && $.isPlainObject(v)) ? v[uid] : v;

                // 有特定广告位id的直投广告 先隐藏网盟 再显示直投
                if ($.trim(v)) {
                    element.children(':first-child').remove();
                    element.html(v);

                    $body.addClass('view-fh-ad-' + (+k));

                    isHasFhAd = true;
                }
                // 无特定广告位id直投广告显示网盟
                else {
                    element.children(':first-child').show();

                    $body.addClass('view-fh-ad-' + (+k) + '-union');
                }

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