How to use the zepto.post 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 / src / mip-iask-ext / mip-iask-ext.js View on Github external
function (e) {
                        if (e == null || e === 'null') {
                            // 跳转到登录页面
                            var thisHref = window.location.href;
                            window.location.href = 'https://mipp.iask.cn/login?source=' + thisHref;
                        }
                        else {
                            var questionId = $('.report_id').text();
                            var type = $('.report_type').text();
                            var typeId = $('.report_typeId').text();
                            $.post('http://m.iask.sina.com.cn/question/reportnew', {
                                'reportList': reportList,
                                'questionId': questionId,
                                'type': type,
                                'typeId': typeId
                            },
                            function (data) {
                                var res = $.parseJSON(data);
                                alert(res.desc);
                            });
                            effects.clearReport();
                        }
                    });
                }
github mipengine / mip-extensions-platform / mip-linkeddb-relmap / mip-linkeddb-relmap.js View on Github external
function makeRolesRel(url, epcount, echartId) {
            $.post(url, function (json) {

                var dataset = json.data;
                var len = epcount;
                // 自变量(横轴)
                var xArray = [];
                for (var i = 1; i <= len; i++) {
                    xArray.push('第' + i + '集');
                }

                // 因变量(y轴)
                var yArray = [];

                for (var j = 1; j <= len; j++) {
                    var num = 0;
                    if (dataset.length >= 1) {
                        num = findNum(dataset, j);
github mipengine / mip-extensions-platform / mip-linkeddb-relmap / mip-linkeddb-relmap.js View on Github external
function initData(id, url, postData, sortField) {

            $.post(url, postData, function (data) {

                if (data.nodes.length < 1) {
                    return;
                }
                allData = data;

                nodesData = data.nodes;
                linksData = data.links;
                // 进行去重
                //  nodesData = uniqeByKeys(nodesData,['name']);
                // 进行去重
                linksData = uniqeByKeys(linksData, ['source', 'target']);
                // 线条排序
                linksData.sort(function (a, b) {
                    return (parseInt(a.target, 10)
                        + parseInt(a.source, 10)) - (parseInt(b.target, 10) + parseInt(b.source, 10));
github mipengine / mip-extensions / mip-iask-ajax / mip-iask-ajax.js View on Github external
var ajaxPost = function (url, params, div, type) {
        $.post(url, params,
        function (data) {
            var res = $.parseJSON(data);
            if (type === '1') {
                if (res.succ === 'Y' && res.jsonData === '1') {
                    var txt = $(div);
                    txt.text(parseInt(txt.text(), 0) + 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());
            } else if (data === 'OK') {
                $('.comment .text').focus();
                $('.comment .text').val('');
                $('.yzm').val('');
                alert('你的评论发表成功,需要审核才能显示!');
            } else {
github mipengine / mip-extensions-platform / mip-linkeddb-comment / mip-linkeddb-comment.js View on Github external
function getComment() {

            $.post('https://mip.linkeddb.com/comment_list/', {
                'obj_type': pageType,
                'obj_oid': pageOid
            }, function (res) {

                if (res.response === '1') {
                    setCommentModule(res);
                }
            });
        }
github mipengine / mip-extensions-platform / mip-ajax-one / mip-ajax-one.js View on Github external
$(ele).on('click', function () {
            var type = ele.getAttribute('type');
            var page = ele.getAttribute('page');
            var target = ele.getAttribute('target');
            var url = '/index.php?m=splist&c=index&a=getzt_data';
            var data = {
                page: page,
                type: type
            };
            $.post(url, data, function (result) {
                response(result);
            }, 'json');
            function response(result) {
                var html = '';
                $.each(result, function (i, o) {
                    if (i % 2 === 0) {
                        html += '<div class="mainDetailModel lf">';
                    } else {
                        html += '<div class="mainDetailModel rt">';
                    }
                    html += '<div class="mainDetailPic"><a href="/special/';
                    html += o.tag_pinyin;
                    html += '.html"><img alt="" src="http://www.aidigong.com/uploadfile/';
                    html += o.path;
                    html += '"></a></div>';
                    html += '<p class="mainDetailTitle">';</p></div></div>
github mipengine / mip-extensions-platform / mip-zpm-sindex / mip-zpm-sindex.js View on Github external
searchTime = setTimeout(function () {
                    var hotWordsArray = [];
                    var sw = $searchInput.val();
                    if (prevStr === $searchInput.val()) {
                        return false;
                    }
                    $.post('https://mip.zhaopin.com/searchjob/SearchRedolent', {
                        keyword: $searchInput.val()
                    }, function (data, textStatus, jqxhr) {
                        $SearchLsWrap.show().children('dd').remove();
                        if (data.HotWords.length &gt; 0) {
                            hotWordsArray = data.HotWords;
                        } else {
                            $SearchLsWrap.find('dt').hide();
                        }
                    }, 'json');
                    if (hotWordsArray.length &gt; 0) {
                        $.each(hotWordsArray, function (i, v) {
                            v.Word = v.Word.replace(sw, '<span class="gl">' + sw + '</span>');
                            $('<dd><a>' + v.Word + '</a><span class="add"></span></dd>').prependTo($SearchLsWrap);
                        });
                        $SearchLsWrap.find('.clear').hide();
                    }
github mipengine / mip-extensions-platform / mip-hlvask / mip-hlvask.js View on Github external
$('#doask').on('click', function () {
            var askcontent = $('#askContent').val();
            var asktel = $('#askTel').val();
            $.post('https://mip.66law.cn/ajax/question_ajax.aspx', {type: 'ask', pid: pid, cid: cid, guid: guid, content: askcontent, tel: asktel}, function (res) {
                if (res.state === 1) {
                    window.location.href = 'http://m.66law.cn/user/public_admin/myquestion.aspx';
                }
                $('#show-tj').find('span').text(res.msg);
                $('#show-tj').show();
            }, 'json');
            setTimeout(function () {
                $('#show-tj').hide();
            }, 4000);
        });
    };

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

Similar packages