承接 ilopx/jquery-ajax-progress 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ilopx/jquery-ajax-progress

最新稳定版本:1.2.1

Composer 安装命令:

composer require ilopx/jquery-ajax-progress

包简介

Simple patch that adds a 'progress' callback to jquery Ajax calls

README 文档

README

A simple patch to jQuery that will call a 'progress' callback, using the XHR.onProgress event

Video demo

Video Demo

Install and use

a. CDN

jquery.ajax-progress.js or jquery.ajax-progress.min.js

Include the script on your page:

<script src="https://cdn.rawgit.com/ilopX/jquery-ajax-progress/master/dist/jquery.ajax-progress.js"></script>

or

<script src="https://cdn.rawgit.com/ilopX/jquery-ajax-progress/master/dist/jquery.ajax-progress.min.js"></script>

b. Install

bower install ilopx-jquery-ajax-progress
composer require ilopx/jquery-ajax-progress

Use simple template script

template.js

$(function() {
    $.ajax({
        method: 'GET',
        url: '', // TODO: add url
        data: {
            // TODO: add data
        },
        success: function() {
            // TODO add message all ok
        },
        error: function() {
            // TODO add message error
        },
        progress: function(e) {
            if(e.lengthComputable) {
                var progress = e.loaded / e.total * 100;
                var content = e.srcElement.responseText;
            }
            else {
                // TODO add message error 'Content Length not reported!';
            }
        }
    });
});

Notes

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 81
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-23