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.
JavaScript, Browser
Learn all of the options JavaScript provides for modifying the URL of the current page in the browser without reloading the page.
JavaScript, String
Avoid the naive approach and use a more robust method to edit URL parameters in JavaScript.
JavaScript, Browser
A quick reference for the window.location
object.
JavaScript, Browser
Returns the current URL.
JavaScript, Browser
Redirects the page to HTTPS if it's currently in HTTP.
JavaScript, Browser
Creates an object containing the parameters of the current URL.
JavaScript, String
Gets the current URL without any parameters or fragment identifiers.
JavaScript, Browser
Redirects to a specified URL.
JavaScript, String
Checks if the given string is an absolute URL.
JavaScript, Object
Checks if two URLs are on the same origin.
JavaScript, String
Joins all given URL segments together, then normalizes the resulting URL.