GithubHelp home page GithubHelp logo

wenxiayili / jquery-deserialize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kflorence/jquery-deserialize

0.0 1.0 0.0 152 KB

Decodes serialized form data and populates a form with that data.

Home Page: http://kflorence.github.com/jquery-deserialize/

License: GNU General Public License v2.0

JavaScript 55.70% HTML 44.30%

jquery-deserialize's Introduction

jQuery.deserialize

$("form").deserialize(data[, options]);

Decodes serialized form data and populates the form with that data. This method works upon text strings in standard URL-encoded notation, arrays containing objects of name/value pairs or objects containing name/value pairs. Thus, the plugin is compatibile with the data collected using the following methods:

Install

Download as NPM module:

npm install jquery-deserialize

Download as Bower component:

bower install jquery-deserialize

Example

Populate a form on page load using query string parameters:

jQuery(function( $ ) {
    $( 'form' ).deserialize( location.search.substr( 1 ) );
});

Arguments

The plugin accepts two arguments: data and options, the latter being optional. Passing the complete() function as the second argument to this plugin is also supported.

  • data String, Array, Object A serialized (and/or encoded) String, an Array of objects containing name/value pairs, or an object of name/value pairs.
  • options Object An object of key/value pairs that configure the plugin.
    • change Function Called for every changed input value.
    • complete Function Called when all of the inputs have been updated.
    • filter String|Function|Element|jQuery A custom filter to identify inputs to deserialize. By default, all inputs that are not disabled will be deserialized (this matches the behavior of serialization).

Requirements

jQuery.deserialize requires:

License

Copyright (c) 2017 Kyle Florence
jQuery.deserialize is dual licensed under MIT and GPLv2 licenses.

jquery-deserialize's People

Contributors

kflorence avatar hudochenkov avatar gui avatar pjfarsi avatar lachezar avatar

Watchers

James Cloos 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.