How to use the zepto.getJSON 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-3h3-all / mip-3h3-all.js View on Github external
customElement.prototype.firstInviewCallback = function () {
        var t = this.element;
        var gtype = t.getAttribute('g_type');
        var siteurl = '//m.3h3.com/';
        if (gtype === '3h3_news') {
            // 点击量统计
            var module = t.getAttribute('module');
            var hitsurl = siteurl + 'ajax.asp?action=4&id=' + t.getAttribute('id');
            if (module !== '') {
                hitsurl += '&module=' + module;
            }
            $.getJSON(hitsurl);
        } else if (gtype === '3h3_youxi_content_hideshow') {
            // 内容缩进
            var con = $(t);
            if (con.height() > 200) {
                var newcon = con.find('.m-con');
                newcon.addClass('wraptext');
                newcon.addClass('snbg');
                var btn = con.find('.m-show');
                btn.click(function () {
                    if ($(this).hasClass('show')) {
                        newcon.addClass('wraptext');
                        newcon.addClass('snbg');
                        $(this).removeClass('show');
                    } else {
                        newcon.removeClass('wraptext');
                        newcon.removeClass('snbg');
github mipengine / mip-extensions / src / mip-iask-business / mip-iask-business.js View on Github external
var ipLoad = function (callback) {
//        var url = 'http://ipip.iask.cn/iplookup/search?format=json&callback=?';
    	var url = 'https://mipp.iask.cn/iplookup/search?format=json&callback=?';
        try {
            $.getJSON(url, function (data) {
                callback(data);
            });
        }
      catch (e) {}
    };
github mipengine / mip-extensions / mip-xueyou-article / mip-xueyou-article.js View on Github external
}
                else {
                    setCookie('admbottom', 'close');
                    admbottom.removeClass('fix');
                }
                dbshow || opendubao();
            });
        }
        // 统计系统
        var readed = getCookie('readed_' + docId);
        var dtp = 'wenku';
        if (parseInt(docId, 10) < 356835) {
            dtp = 'fanwen';
        }
        if (readed !== 'false') {
            $.getJSON('http://www.wangshengbo.cn/api/' + dtp + '/hits/?id=' + docId + '&code=' + code + '&jsoncallback=?',
                function (rda) {
                    setCookie('readed_' + docId, 'false');
                }
            );
        }
        function getScrollTop() {
            var scrollTop = 0;
            if (document.documentElement && document.documentElement.scrollTop) {
                scrollTop = document.documentElement.scrollTop;
            }
            else if (document.body) {
                scrollTop = document.body.scrollTop;
            }
            return scrollTop;
        }
        function setCookie(name, value) {
github mipengine / mip-extensions-platform / mip-fh-zhida-plus / mip-fh-zhida-plus.js View on Github external
function getFhAd(opt) {
        opt = opt || {};
        var adUrl = opt.adUrl;
        var query = opt.query;
        var element = opt.element;
        var uid = '';

        $.getJSON(adUrl, query, function (res) {
            var isHasFhAd;
            var data = $.parseJSON(res.result);

            // 遍历直投广告ID
            $.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();
github mipengine / mip-extensions-platform / mip-fh-ad-plus / mip-fh-ad-plus.js View on Github external
function getFhAd(opt) {
        opt = opt || {};
        var adUrl = opt.adUrl;
        var query = opt.query;
        var element = opt.element;
        var uid = '';

        $.getJSON(adUrl, query, function (res) {
            var isHasFhAd;
            var data = $.parseJSON(res.result);

            // 遍历直投广告ID
            $.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();
github mipengine / mip-extensions-platform / mip-iask-business / mip-iask-business.js View on Github external
var ipLoad = function (callback) {
        var url = 'https://ipip.iask.cn/iplookup/search?format=json&callback=?';
//         var url = 'https://mipp.iask.cn/iplookup/search?format=json&ip=43.226.37.75&callback=?';
        try {
            $.getJSON(url, function (data) {
                callback(data);
            });
        }
      catch (e) {}
    };
    var hotRecommendUnLi = function (url, img, title, statsBaid, pos) {
github mipengine / mip-extensions / mip-fh-ad-plus / mip-fh-ad-plus.js View on Github external
// 设置配置项默认值
        var posId = [opt.posId] || [1];
        var kw = opt.kw || '';
        var element = opt.element;

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

        var FhAdPutNum = $('mip-fh-ad-plus').length;

        // 判断直投广告参数,是否加载直投广告请求
        if (kw && kw.length) {
            $.getJSON(adUrl, query, function (res) {
                var fhAdNum = $body.attr('fh-ad-num') || 0;

                var data = $.parseJSON(res.result);

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

                        $body.addClass('view-fh-ad-' + (+k));
                        $body.attr('fh-ad-num', ++fhAdNum);
                    }
                    // 无特定广告位id直投广告显示网盟
                    else {
github simonsmith / simonsmith.io / assets / scripts / modules / MorePosts.js View on Github external
getPosts: function() {
            mediator.publish('posts:get:before');

            $.getJSON('/more-posts/?limit=5&offset=' + this.offset, function(response) {
                mediator.publish('posts:get:done', response);
            });
        },
github mipengine / mip-extensions-platform / mip-fh-zhida-plus / mip-fh-zhida-plus.js View on Github external
function getIP(opt, cb) {
        opt = opt || {};

        $.getJSON(ipUrl, function (json) {
            var res = json || {};
            util.fn.isPlainObject(opt.query) && (opt.query.ip = res.ip);

            if ((typeof cb).toLocaleLowerCase() === 'function') {
                cb(opt);
            }
        });
    }
github mipengine / mip-extensions-platform / mip-lscyb-list / mip-lscyb-list.js View on Github external
function dropload(element, options) {
            ++ajaxs.nowPage;
            var count = options.count;
            var appmore = $(element).find('.appmore');
            appmore.html(ajaxs.downhtml);
            ajaxs.ajaxUrl = options.url + '&page=' + ajaxs.nowPage;
            $.getJSON(ajaxs.ajaxUrl + '&callback=?', function (data) {
                if (ajaxs.nowPage >= count) {
                    $(element).find('.dropload-down').html(endhtml);
                    return;
                }
                if (parseInt(count, 10) === 0) {
                    return;
                }
                $(element).find('#applist').append(data);
                appmore.html('<div class="dropload-down"><div class="dropload-refresh">↑上拉加载更多</div></div>');
            });
        }

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