Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knowledgecode/jquery-param
equivalent function to jQuery.param
https://github.com/knowledgecode/jquery-param
equivalent javascript jquery param post serialize
Last synced: 5 days ago
JSON representation
equivalent function to jQuery.param
- Host: GitHub
- URL: https://github.com/knowledgecode/jquery-param
- Owner: knowledgecode
- License: mit
- Created: 2015-03-26T15:03:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-28T05:56:19.000Z (3 months ago)
- Last Synced: 2024-12-11T04:07:02.474Z (12 days ago)
- Topics: equivalent, javascript, jquery, param, post, serialize
- Language: JavaScript
- Homepage:
- Size: 344 KB
- Stars: 64
- Watchers: 4
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-param
[![Circle CI](https://circleci.com/gh/knowledgecode/jquery-param.svg?style=shield)](https://circleci.com/gh/knowledgecode/jquery-param)
## Features
- Equivalent to jQuery.param (based on jQuery 3.x)
- No dependencies
- Universal (Isomorphic)
- ES Modules Support## Installation
via npm:
```shell
npm i jquery-param
```## Usage
```javascript
import param from 'jquery-param';const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
const str = param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
```CommonJS:
```javascript
const param = require('jquery-param');const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
const str = param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
```ES Modules (Browser):
```html
import param from '/path/to/jquery-param.js';
const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
const str = param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"```
Traditional (Browser):
```html
<script>
var obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
var str = window.param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"```
## Browser Support
Chrome, Firefox, Safari, Edge, and IE9+.
## License
MIT