Code Monkey home page Code Monkey logo

zepto.form.js's Introduction

zepto.form.js

在使用zepto过程中会遇到ajax提交表单的情况,在使用jquery库的情况下,可以使用jquery.form.js来完成。在zepto下,使用jquery.form.js是不能正常使用的(即使jquery.form.js说支持,但是情况不理想)。

之后在网上找到解决方案 http://blog.csdn.net/laotoumo/article/details/51205109,但是此办法依旧存在问题,仔细研究下发现它提交的字段有限制,并且对于<input name='code[]' type='text'>这种表单存在问题,即数组型的支持不好。

基于上述进行修改,把获取字段名和内容那一块使用serializeArray()方法来替代。

Relace of jquery.form.js, fix some bugs base on http://blog.csdn.net/laotoumo/article/details/51205109。Weclome U to complete the English Docment。

usage & demo

$(obj).ajaxSubmit({
    dataType:  'json',
    success: function(data) {
        // handle the sucess callback
        console.log('request success');
    },
    error:function(xhr){
        // handle the error callback
        console.log('request error');
    },
    beforeSend:function(){
        // handle the beforeSend
        console.log('beforeSend');
    },
    complete:function(){
        // handle the complete
        console.log('request complete');
    }
});

zepto.form.js's People

Contributors

rovast avatar

Watchers

James Cloos avatar 土豆先生 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.