JSPM

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

A function that is equivalent of 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 output of jQuery.param
  • not need jQuery
  • no dependency
  • legacy IE support

WHY

In case that want to transmit a post request in such as Web Workers which cannot use jQuery. At least I've made this for it :-).

Install

Node.js:

$ npm install jquery-param --save

Bower:

$ bower install jquery-param

browser:

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

Usage

Node.js:

var param = require('jquery-param');
var obj = { key1: 'value1', key2: [10, 20, 30] };

var str = param(obj);
// "key1=value1&key2%5B%5D=10&key2%5B%5D=20&key2%5B%5D=30"

browser:

var obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };

var str = window.param(obj);
// "key1%5Bvalue1%5D%5B%5D=10&key1%5Bvalue1%5D%5B%5D=20&key1%5Bvalue1%5D%5B%5D=30&key2=%3Fa%3Db%26c%3Dd"

Browser Support

Chrome, Firefox, Safari, Opera, and Internet Explorer 6+.

License

MIT