Try this:
let path = window.location.href.split('?')[0]
console.log({path})
More Related Contents:
- How To Display Images Preview and Title When I Paste in Another Site Like Facebook, Whatsapp, etc
- How to pass parameter in url? pl. explain with example?
- How can I get query string values in JavaScript?
- Get escaped URL parameter
- Is there any way to specify a suggested filename when using data: URI?
- Change URL parameters and specify defaults using JavaScript
- Get protocol, domain, and port from URL
- Get the values from the “GET” parameters (JavaScript) [duplicate]
- How to get the anchor from the URL using jQuery?
- Using the GET parameter of a URL in JavaScript [duplicate]
- How to create query parameters in Javascript?
- Parsing URL hash/fragment identifier with JavaScript
- How to check if the URL contains a given string?
- Go to local URL with Javascript
- Change URL and redirect using jQuery
- Redirecting to a relative URL in JavaScript
- How to replace url parameter with javascript/jquery?
- Regular Expression – Extract subdomain & domain
- Angular url plus sign converting to space
- Usage of Hash(#) in URL
- How to change the URL displayed in the browser without leaving the page
- Relative URLs in AJAX requests
- How to test if a URL string is absolute or relative?
- How do I URl encode something in Node.js?
- Is there any way to download csv file from “website button click” using Python?
- How to assign a domain name to node.js server? [duplicate]
- get url after “#” in express.js middleware request
- Why is “javascript:” pseudo-protocol stripped from URL bar when pasted?
- Extract keyword from Google search in Javascript
- How could I change window’s location without reloading and # hack?