Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    codex.transportpublic

    codex.transport

    One click file uploader

    Usage

    transport.init({
       url: '/ajax/transport',
       multiple: true,
       accept: 'image/*',
       data: {},
       before: function () {},
       progress: function (percentage) {
           console.log(percentage + '%');
           // ...
       },
       success: function (response) {
           console.log(response);
           // ...
       },
       error: function (response) {
           console.log(response);
           // ...
       },
       after: function () {},
    });

    You can handle all of this event like:

    • what should happen before data sending with XMLHTTP
    • what should after success request
    • error handler

    Keywords

    none

    install

    npm i codex.transport

    Downloadsweekly downloads

    19

    version

    3.2.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar