How can I use JavaScript to scrape the URL and then use the first directory of the URL. So for example if I had a URL like domain.com/Organisations/Manage the bit I would want to use is Organisations.
Note that this app can also run in development modes where it has prefixes on the url such as localhost:8888/AppName/Organisations/Manage
The reason for this is to apply the name to the body as an Id such as <body id="Organisations">
Any help would be much appreciated. Thanks
You’ll need to slice up
document.location.pathname. If"Organisations"always second from the last part of the path, then you could use this: