URLs are an integral part of the web, which makes working with them an essential skill to have. This snippet collection contains the necessary resources to master URLs in JavaScript and level up your skills.
Learn all of the options JavaScript provides for modifying the URL of the current page in the browser without reloading the page.
JavaScript, Browser · Sep 27, 2021
A short guide on how to correctly construct a URL in JavaScript.
JavaScript, String · Feb 26, 2023
Avoid the naive approach and use a more robust method to edit URL parameters in JavaScript.
JavaScript, String · Dec 7, 2022
Need to reload the current page using JavaScript? Here's the best way to do it, as well as some alternatives.
JavaScript, Browser · May 14, 2023
A quick reference for the window.location
object.
JavaScript, Browser · Dec 21, 2022
Redirects the page to HTTPS if it's currently in HTTP.
JavaScript, Browser · Oct 22, 2020
Creates an object containing the parameters of the current URL.
JavaScript, Browser · Oct 22, 2020
Gets the current URL without any parameters or fragment identifiers.
JavaScript, String · Jan 3, 2021
Checks if the given string is an absolute URL.
JavaScript, String · Oct 20, 2020
Joins all given URL segments together, then normalizes the resulting URL.
JavaScript, String · Oct 22, 2020