Web APIs

URL API

Checking compatibility...

The URL API provides an interface for creating and manipulating URLs, as well as for easily extracting the various components of a URL (protocol, hostname, pathname, query parameters, etc.).

URL Constructor and Properties

Create and parse web addresses with ease. This example shows how to break down a URL into its components (like domain, path, and protocol) and access them through simple properties, making it much easier to work with links in your code.

=
=
=
=
=
=

Output

Click Run to see output...

URL Search Parameters

Handle query strings (the part after the ? in a URL) without the hassle. This example demonstrates how to add, remove, and retrieve parameters from a URL's query string, perfect for building dynamic links or processing form submissions.

=
=
=
=
=
=

Output

Click Run to see output...

URL Manipulation

Change parts of a URL dynamically without breaking the whole address. This example shows how to modify specific components of a URL (like changing the domain or adding a path segment) while the API automatically handles all the encoding and formatting details.

=
=
=
=
=
=

Output

Click Run to see output...