How to use the zepto.ajax 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-taoge-scaydk / mip-taoge-scaydk.js View on Github external
$('.tel').click(function (event) {
            var url = getBaseUrl() + '/mip/index/telephone_recording';
            var ajaxTimeoutTest = $.ajax({
                type: 'POST',
                timeout: 3000,
                url: url,
                data: {type: 'telephone'},
                complete: function (XMLHttpRequest, status) {
                    if (status === 'timeout') {
                        ajaxTimeoutTest.abort();
                        // console.log("请求超时");
                    }
                },
                dataType: 'json'
            });
        });
    };
github mipengine / mip-extensions-platform / mip-ilaw66-baidu-order / mip-ilaw66-baidu-order.js View on Github external
function load() {
            var requestId = $el.find('#requestId').val();
            var questionType = $el.find('#questionType').val();
            //          $el.find('#loading_pop').addClass('alertactivefalse');
            //          if (paystart) {
            //              $el.find('#payalert').addClass('alertactivetrue');
            //          }

            $.ajax({
                type: 'GET',
                // url: 'data.json'
                url: hosturl + 'selectOrderV1?id=' + requestId + '&sessionId=' + sessionId,
                async: false,
                success: function (data) {

                    var qusetype = data.questionType;
                    $el.find('#questionType').val(qusetype);
                    function orderStatusLabel(status, unpaidAmount) {
                        if (unpaidAmount === 0) {
                            return status;
                        }
                        else {
                            return '待支付';
                        }
                    }
github mipengine / mip-extensions-platform / mip-ilaw66-baidutwo-index / mip-ilaw66-baidutwo-index.js View on Github external
function getUserCommentContent(pag) {
            //          var usercomment_date = {};
            //          var usercomment_date.list = [];
            $.ajax({
                //		        url:"user/review",
                url: 'user/review?from=index',
                type: 'get',
                //              data: {
                //                  from: pag
                //              },
                success: function (data) {

                    var commentData = (data.data);
                    if (!data || !data.data || data.data.length < 1) {
                        $('.usercomment_div').hide();
                        return;
                    }

                    //		            for (var i = 0; i < data.data.length; i++) {
                    //		                var temp = data.data[i];
github mipengine / mip-extensions-platform / mip-point-method / mip-point-method.js View on Github external
function dingComment(index, str, str2, ding, idname) {
        var p = '/' + index + '.php?m=' + str2 + '&a=' + ding + '&id=' + str + '&now=' + Math.random();
        var htmlobj = $.ajax({url: p, async: false});
        $('#' + idname + str).html($.trim(htmlobj.responseText));
    }
    // 评论顶
github mipengine / mip-extensions-platform / mip-taoge-scaydk-qe / mip-taoge-scaydk-qe.js View on Github external
}
            else {
                $('mip-form > form > div.form-group').each(function (k, v) {
                    if (k > i) {
                        if ($(this).find('select').length > 0) {
                            $(this).removeClass('show').addClass('hidden');
                        }
                        else {
                            return false;
                        }
                    }
                });
            }
        });
        // 初始化银行下拉列表
        var ajaxTimeoutTest = $.ajax({
            type: 'GET',
            timeout: 3000,
            url: getBaseUrl() + '/static/mobile/js/bankData.json',
            data: {},
            success: function (result) {
                var option = '';
                $.each(result, function (k, v) {
                    option += '<option value="' + v.bin + '">' + v.bankName + '</option>';
                });
                $('#anjiefangyinhang,#anjiecheyinhang').append(option);
            },
            complete: function (XMLHttpRequest, status) {
                if (status === 'timeout') {
                    ajaxTimeoutTest.abort();
                }
            },
github TrueLink / TrueLink / js / misc / CouchFetching.js View on Github external
beginRequest: function (channelName, since) {
            var url = this._getUrl([channelName], since);
            this.ajax = $.ajax({
                url: url,
                dataType: "json",
                context: this,
                timeout: ajaxTimeout,
                success: function (data, status, xhr) { this._handleResult(data, since); },
                error: function (xhr, errorType, error) {
                    if (errorType !== "timeout" && errorType !== "abort") {
                        console.warn("Message polling failed: ", error || errorType);
                    }
                    if (errorType !== "abort") {
                        this._repeatRequest(channelName, since, errorType === "timeout" ? null : 5000);
                    }
                }
            });
        },
github mipengine / mip-extensions-platform / mip-user-gift / mip-user-gift.js View on Github external
ele.addEventListener('click', function () {
            var options = {
                url: mobileDomain + 'index.php?c=welfare&a=get_user_gift',
                type: 'POST',
                dataType: 'json',
                data: {'gift_id': giftId},
                success: function (data) {
                    if (data.code === 2) {
                        window.top.location.href = mobileDomain + 'account.php?c=account';
                    }
                    else {
                        showTip(data, 0);
                    }
                }
            };
            $.ajax(options);
        });
    };
github mipengine / mip-extensions-platform / mip-get-gift / mip-get-gift.js View on Github external
}
                    else if (data.code === 1) {
                        $('#rest_num_' + giftId).html($('#rest_num_' + giftId).html() - 1);
                        ele.className = ele.className.replace('get_welfare', 'have_getten');
                        ele.innerHTML = '已领取';
                        showTip(data, 0);
                    }
                    else if (data.code === 10) {
                        showTip(data, 1);
                    }
                    else {
                        showTip(data, 0);
                    }
                }
            };
            $.ajax(options);
        });
    };
github simonsmith / simonsmith.io / assets / scripts / modules / PageController.js View on Github external
fetchFromServer: function(href) {
            var req = $.ajax({
                data: { ajax: true },
                dataType: 'json',
                context: this,
                timeout: 6000,
                url: href,
                beforeSend: function() {
                    mediator.publish('content:get:before');
                }
            });

            req.always(function() {
                mediator.publish('content:get:always');
            });
            req.fail(function() {
                mediator.publish('content:get:fail');
            });
github mipengine / mip-extensions-platform / mip-meishij / mip-meishij.js View on Github external
function jsonpPost(url, data, cb) {
        return $.ajax({
            type: 'POST',
            data: data,
            url: url,
            dataType: 'jsonp',
            success: cb
        });
    }

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