JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23486
  • Score
    100M100P100Q139572F
  • License MIT

equivalent function to jQuery.param

Package Exports

  • jquery-param

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jquery-param) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jquery-param

Circle CI

Features

  • Equivalent to jQuery.param (based on jQuery 3.x)
  • No dependencies
  • Universal (Isomorphic)
  • ES5

Installation

Node.js:

$ npm install jquery-param --save

Bower (DEPRECATED):

$ bower install jquery-param

the browser:

<script src="jquery-param.min.js"></script>

Usage

Node.js:

const param = require('jquery-param');

let obj = { key1: 'value1', key2: [10, 20, 30] };
let str = param(obj);
// => "key1=value1&key2[]=10&key2[]=20&key2[]=30"

AMD:

require(['jquery-param'], function (param) {
    var obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
    var str = param(obj);
    // => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
});

directly:

var obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
var str = window.param(obj);    // global object
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"

Browser Support

Chrome, Firefox, Safari, Edge, and IE9+.

License

MIT