JavaScript URL query string manipulation

Paul Watson
Jun 7, 2021

Changing the URL in the browser with JavaScript has long been a difficult and error prone affair.

You’d try to use regular expressions, split, index, and slice to get at the query string. Then you’d make your change, removal, or addition and then try to use join to put it all back together.

--

--

Paul Watson

Web-developer // Remote working CTO for CaliberAI // Formerly [@Kinzen, ChangeX, Storyful, FeedHenry] // Learning to code since 1993 // South Africa // EOF