No description
  • JavaScript 85.9%
  • HTML 8.6%
  • Makefile 5.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2018-02-28 12:15:46 +01:00
build fix #25 2017-07-28 09:34:02 +01:00
src external methods poly to fix and close #24 2017-05-17 18:22:25 +01:00
template URLSearchParams.prototype.sort():void 2017-05-02 19:11:27 +01:00
test URLSearchParams.prototype.sort():void 2017-05-02 19:11:27 +01:00
.gitignore url-search-params gitstrap initialized 2015-05-28 13:17:40 +02:00
.npmignore Allow .amd.js builds in package 2018-02-28 12:09:46 +01:00
.travis.yml added all iterables 2016-03-16 07:37:39 +00:00
bower.json changed bower target 2016-09-24 08:23:28 +01:00
index.html avoid errors on WebKit 2016-02-19 18:09:01 +01:00
LICENSE.txt URLSearchParams.prototype.sort():void 2017-05-02 19:11:27 +01:00
Makefile fix #25 2017-07-28 09:34:02 +01:00
package-lock.json 0.10.0 2017-07-28 09:34:05 +01:00
package.json Publish as @github/url-search-params 2018-02-28 12:15:46 +01:00
README.md fix #25 2017-07-28 09:34:02 +01:00

url-search-params

build status CDNJS version donate

This is a polyfill for the URLSearchParams API.

It is possible to simply include build/url-search-params.js or grab it via npm.

npm install url-search-params

The function is exported directly.

var URLSearchParams = require('url-search-params');

MIT Style License

About HTMLAnchorElement.prototype.searchParams

This property is already implemented in Firefox and polyfilled here only for browsers that exposes getters and setters through the HTMLAnchorElement.prototype.

In order to know if such property is supported, you must do the check as such:

if ('searchParams' in HTMLAnchorElement.prototype) {
  // polyfill for <a> links supported
}

If you do this check instead:

if (HTMLAnchorElement.prototype.searchParams) {
  // throws a TypeError
}

this polyfill will reflect native behavior, throwing a type error due access to a property in a non instance of HTMLAnchorElement.

Nothing new to learn here, just a reminder.